
<template>
	<div class="index">

		<div class="center">
			<left></left>
			<div class="right">
          <top></top>
          <!-- <div class="hei10"></div>
          <div class="where" style="background: #fff; padding: 10px 30px; font-size: 14px; color: #595959;">当前位置：分销后台>
          <router-link to="/order_question/old_dingdan">我的订单</router-link></div>
          --><div class="hei10"></div>
        <div class="o_ul">
          <router-link class="o_li " to="/order_question">我的订单</router-link>
          <router-link class="o_li"  v-if="l04" to="/order_question/orderOther">分销商发展订单</router-link>
          <router-link class="o_li act" to="/order_question/old_dingdan">历史订单查询</router-link>
          <router-link class="o_li "  v-if="l04" to="/order_question/old_Other">分销商发展历史订单</router-link>
        </div>
        <div class="con" style="margin-top: 20px;">
          <el-form ref="form" @submit.native.prevent :model="form" label-width="110px" class="w180">
            <div class="flex">
              <el-form-item label="订单来源">
                <el-input v-model="form.source"></el-input>
              </el-form-item>
              <el-form-item label="订单状态">
                <el-select v-model="form.status" clearable placeholder="请选择订单状态">
                  <el-option :label="item.label" :value="item.value" v-for="(item,index) in peizhis.order_status" :key="index"></el-option>

                </el-select>
              </el-form-item>
              <el-form-item label="按照标旗">
                <el-select v-model="form.flag" clearable placeholder="标旗">
                  <el-option label="灰" value="0">
                    <span style="float: left">
                      <div class="color1"></div>
                    </span>
                    <span class="color1s">灰</span>
                  </el-option>
                  <el-option label="红" value="1">
                    <span style="float: left">
                      <div class="color2"></div>
                    </span>
                    <span class="color2s">红</span>
                  </el-option>
                  <el-option label="黄" value="2">
                    <span style="float: left">
                      <div class="color3"></div>
                    </span>
                    <span class="color3s">黄</span>
                  </el-option>
                  <el-option label="绿" value="3">
                    <span style="float: left">
                      <div class="color4"></div>
                    </span>
                    <span class="color4s">绿</span>
                  </el-option>
                  <el-option label="蓝" value="4">
                    <span style="float: left">
                      <div class="color5"></div>
                    </span>
                    <span class="color5s">蓝</span>
                  </el-option>
                  <el-option label="紫" value="5">
                    <span style="float: left">
                      <div class="color6"></div>
                    </span>
                    <span class="color6s">紫</span>
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="是否联系">
                <el-select v-model="form.is_called" clearable placeholder="是否联系">
                  <el-option label="未联系" value="0">未联系</el-option>
                  <el-option label="已联系" value="1">已联系</el-option>
                </el-select>
              </el-form-item>
            </div>

            <div class="flex">
              <el-form-item label="订单ID">
                <el-input v-model="form.order_id"></el-input>

                <!-- 下周上 -->
                <el-tooltip class="item" effect="dark" content="批量查询" placement="top-start">
                	<span
                		style="position: absolute; right: 10px; top: 0px; color: #1989FA; font-size: 16px; cursor: pointer;"
                		@click="duoxuanlog = true">
                		<i class="el-icon-circle-plus"></i>
                	</span>
                </el-tooltip>

              </el-form-item>
              <el-form-item label="外部订单编号">
                <el-input v-model="form.source_id"></el-input>
              </el-form-item>
              <!-- <el-form-item label="商品筛选:">
                                <el-select v-model="form.product_id" filterable placeholder="请选择" >
                                    <el-option v-for="item in form.prolist" :key="item.id" :label="item.title" :value="item.id"></el-option>
                                </el-select>
              </el-form-item>-->
              <el-form-item label="退款状态">
                <el-select v-model="form.refund_status" clearable placeholder="退款状态">
                  <el-option label="正常" value="100">正常</el-option>
                  <el-option label="退款中" value="200">退款中</el-option>
                  <el-option label="退款成功" value="300">退款成功</el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="商品编码" style="position: relative;">
                <!-- <el-input v-model="form.good_sku"></el-input> -->
                <el-select v-model="form.pages_ids" clearable multiple collapse-tags filterable
                	placeholder="请选择">
                	<el-option v-for="item in allprolist2" :key="item.id" :label="item.fetch_code"
                		:value="item.id"></el-option>
                </el-select>
                <span
                	style="position: absolute; right: -20px; top: 0px; color: #1989FA; font-size: 16px; cursor: pointer;"
                	@click="quanxuanyong">
                	<i class="el-icon-circle-plus"></i>
                </span>
              </el-form-item>
            </div>

            <div class="flex">
              <el-form-item label="身份证号" style="position: relative;">
                <el-input v-model="form.id_card_num"></el-input>

                <el-tooltip class="item" effect="dark" content="批量查询" placement="top-start">
                	<span
                		style="position: absolute; right: 10px; top: 0px; color: #1989FA; font-size: 16px; cursor: pointer;"
                		@click="duoxuanlogx = true">
                		<i class="el-icon-circle-plus"></i>
                	</span>
                </el-tooltip>

              </el-form-item>
              <el-form-item label="生产号码">
                <el-input v-model="form.mobile_produced"></el-input>
                <el-tooltip class="item" effect="dark" content="批量查询" placement="top-start">
                	<span
                		style="position: absolute; right: 10px; top: 0px; color: #1989FA; font-size: 16px; cursor: pointer;"
                		@click="duoschm = true">
                		<i class="el-icon-circle-plus"></i>
                	</span>
                </el-tooltip>
              </el-form-item>
              <el-form-item label="物流单号">
                <el-input v-model="form.tracking_number"></el-input>
              </el-form-item>
              <el-form-item label="收件人电话">
                <el-input v-model="form.address_mobile"></el-input>
              </el-form-item>
            </div>
            <div class="flex">
              <el-form-item label="激活状态">
                <el-select v-model="form.active_status" clearable placeholder="激活状态">
                  <el-option label="无" value="0">无</el-option>
                  <el-option label="已激活" value="100">已激活</el-option>
                  <el-option label="激活且充值" value="200">激活且充值</el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="iccid">
                <el-input v-model="form.iccid"></el-input>
              </el-form-item>
            </div>

            <div class="flex">
              <el-form-item label="时间选择">
                <el-select v-model="form.timems" @change="timemschange" placeholder="时间选择">
                    <el-option label="状态变更时间" value="0">状态变更时间</el-option>
                    <el-option label="用户下单时间" value="1">用户下单时间</el-option>
                    <el-option label="平台创建时间" value="2">平台创建时间</el-option>
                </el-select>
                <el-date-picker style="width: 470px;" v-model="form.time" @change="timechange" :default-time="['00:00:00', '23:59:59']" :clearable='clearable' value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="——" start-placeholder="开始日期" end-placeholder="结束日期" ></el-date-picker>
              </el-form-item>
            </div>
            <el-form-item class="btmm select" label style="margin-left:-60px">
              <el-button type="primary" @click="chongzhisousuo" >重置</el-button>
                <el-button type="danger" @click="search">搜索订单</el-button>
                <!-- <el-button type="danger" @click="daochulog = true">导出订单</el-button> -->
                <!-- <el-button type="danger" @click="daochu" :loading="daochuing">{{daochuingz}}</el-button> -->
								<!-- <el-button type="danger" @click="daochutishi = true" :loading="daochuing">{{daochuingz}}
								</el-button> -->
								<el-button type="danger" @click="daochulogskai" :loading="daochuing">{{daochuingz}}
								</el-button>
                <el-button type="danger" v-if="func_I02" v-loading="shop_id == ''" @click="goupload">照片快速上传</el-button>
                <!-- <el-button type="danger" @click="email">短信通知</el-button> -->
                <el-select v-model="moredo" @change="moredochange" placeholder="批量操作">

                    <el-option label="批量修改产品" value="0">批量修改产品</el-option>
                    <el-option label="批量放弃" value="1">批量放弃</el-option>
                    <el-option label="批量留言" value="2">批量留言</el-option>
                </el-select>
                <el-select v-model="color" @change="moreflag" clearable  placeholder="批量标旗" v-if="func_I02">
                      <el-option label="灰" value="0">
                        <span style="float: left">
                          <div class="color1"></div>
                        </span>
                        <span class="color1s">灰</span>
                      </el-option>
                      <el-option label="红" value="1">
                        <span style="float: left">
                          <div class="color2"></div>
                        </span>
                        <span class="color2s">红</span>
                      </el-option>
                      <el-option label="黄" value="2">
                        <span style="float: left">
                          <div class="color3"></div>
                        </span>
                        <span class="color3s">黄</span>
                      </el-option>
                      <el-option label="绿" value="3">
                        <span style="float: left">
                          <div class="color4"></div>
                        </span>
                        <span class="color4s">绿</span>
                      </el-option>
                      <el-option label="蓝" value="4">
                        <span style="float: left">
                          <div class="color5"></div>
                        </span>
                        <span class="color5s">蓝</span>
                      </el-option>
                      <el-option label="紫" value="5">
                        <span style="float: left">
                          <div class="color6"></div>
                        </span>
                        <span class="color6s">紫</span>
                      </el-option>
                </el-select>
                <div class="bao" style="display: inline-block">
                    <upload-excel-component @on-selected-file="exportData" buttonName="批量导入放弃"></upload-excel-component>
                </div>
                <div class="bao" style="display: inline-block; cursor: pointer; color: #197cff; font-size: 14px; margin-left: 10px;" @click="xiazaifangqi">模板下载</div>
            </el-form-item>

          </el-form>
<div v-if="daochutishi" style=" border: 1px #EAEAEA solid; margin: 0 20px; padding: 10px 10px; background: #fffcf3;">
               <div style="font-size: 14px; margin-bottom: 10px; font-weight: bold; color: #333333;">为了给您提供更好的查询性能以及体验，我们对导出功能进行了更改：</div>
               <div style="padding-left: 20px; font-size: 14px; color: #666666; ">1.超出6个月的订单请前往历史订单查询</div>
               <div style="padding-left: 20px; font-size: 14px; color: #666666; display: flex;  justify-content: space-between; align-items: center;" >
                 <div>2.我们将为您保留已生成的数据，便于您随时导出使用</div>
                 <div>
                   <!-- <el-button type="primary" @click="xiazai">生成报表</el-button> -->
                   <el-button type="primary" @click="daochulogskai">生成报表</el-button>
                   <el-button type="primary" @click="goxiazai">查看已经生成的报表</el-button>
                 </div>
                </div>
          </div>
          <div class="powertable" v-loading="loading">
  <!--          <div class="newsearch">
              <div :class="act == 1 ? 'news1 act':'news1'" @click="searchall">全部订单</div>
              <span class="shuxian"><img :src="srcxian"></span>
              <div :class="act == 4 ? 'news1 act':'news1'" @click="wait">等待照片上传订单</div>
              <span class="shuxian"><img :src="srcxian"></span>
              <div :class="act == 2 ? 'news1 act':'news1'" @click="shenfail">证件不合格订单</div>
              <span class="shuxian"><img :src="srcxian"></span>
              <div :class="act == 3 ? 'news1 act':'news1'" @click="kaifail">开卡失败订单</div>
              <span class="shuxian"><img :src="srcxian"></span>
              <div :class="act == 5 ? 'news1 act':'news1'" @click="autofail">自动发货失败订单</div>
              <span class="shuxian"><img :src="srcxian"></span>

              <div :class="act == 6 ? 'news1 act':'news1'" @click="tuikuan">退款拦截</div>
              <span v-if="shop_id == 50481 || shop_id == 304676"  class="shuxian"><img :src="srcxian"></span>

              <div v-if="shop_id == 50481 || shop_id == 304676" :class="act == 7 ? 'news1 act':'news1'" @click="linshi">临时补充照片</div>

            </div> -->
            <div class="newlist newflex" style="margin-bottom: 10px;" v-if="act == 5">
              <div class="newleft new-left">
                <div class="newthli1 checkBtn">
                  <div class="checkAll" style="margin-left: 16px;margin-right: 10px;">
                    <input type="checkbox" @change="quanxuan" value="0" v-model="quanxuana" />全选
                  </div>
                  <el-button size="small" @click="dispose">批量处理</el-button>


                  <div class="bao" style="display: inline-block">
                      <upload-excel-component @on-selected-file="exportData" buttonName="按导入已处理"></upload-excel-component>
                  </div>
                  <div style="margin-left:20px; color:#197cff" @click="uploadexcle">下载模板</div>
                  <div class="pageBox">
                    <el-pagination layout="prev, next" :current-page="page" @current-change="fanye" :page-size="page_size" :total="total"  prev-text="上一页"  next-text="下一页"></el-pagination>
                  </div>
                </div>
              </div>
            </div>
            <div class="newlist newflex" style="margin-bottom: 10px;" v-if="act == 6">
              <div class="newleft new-left">
                <div class="newthli1 checkBtn">
                  <div class="checkAll" style="margin-left: 16px;margin-right: 10px;">
                    <input type="checkbox" @change="quanxuan" value="0" v-model="quanxuana" />全选
                  </div>
                  <el-button size="small" @click="again">继续生产</el-button>
                  <el-button size="small" @click="goLan" style="color:#197CFF;border-color: #197CFF;padding-bottom: 8px;">拦截设置<i class="el-icon-s-operation" style="color: #197CFF;"></i></el-button>
                  <div class="pageBox">
                    <el-pagination layout="prev, next" :current-page="page"  @current-change="fanye" :page-size="page_size" :total="total"  prev-text="上一页" next-text="下一页"></el-pagination>
                  </div>
                </div>
              </div>
            </div>
            <div class="newlist newflex" style="margin-bottom: 10px;position: relative;">
              <div class="newleft" style="position: relative;">
                <div style="position: absolute; left:20px; top:10px;"><input type="checkbox" @change="quanxuan" value="0" v-model="quanxuana" v-if="act!=5&&act!=6" /></div>
                <div class="newthli" style="position: relative;">
                  订单信息
                  <div  @click="shunxu" style="cursor: pointer; position: absolute; right:-20px; top: 0;">
                    时间排序
                    <i class="el-icon-top" style="color: #2974FF;" v-if="!desc"></i>
                    <i style="color: #2974FF;" class="el-icon-bottom" v-if="desc"></i>
                  </div>
                </div>

                <div class="newthli">收件人管理</div>
                <div class="newthli">备注&失败原因</div>
                <div class="newthli" style="flex:0.7">订单状态</div>
                <div class="newthli" style="flex:0.7">生产信息</div>
                <div class="newthli" style="flex:0.7">操作</div>
              </div>
              <!-- <div class="newright">

              </div> -->
            </div>
						<div v-if="list == ''" style="text-align: center; color: #ccc; font-size: 16px; padding: 30px;">
							由于历史订单过多，请输入条件进行搜索查看！
						</div>
            <div class="newlist newlistbor" v-for="item in list" :key="item.id">
              <div class="newh">
                <div class="newleft" >
                  <div class="newhli"><input type="checkbox" :value="item.id" @change="danxuan" v-model="danxuans"  /></div>
                  <div class="newhli">
                    订单ID：{{item.id}}
                    <i
                      class="el-icon-document-copy"
                      style="color: #077ECE; font-size: 16px; margin-left: 10px; cursor: pointer;"
                      @click="copy(item.id)"
                    ></i>
                  </div>
                  <div class="newhli" style="display:flex">
                    订单来源：{{item.source}}
                    <!-- <i class="el-icon-document-copy" style="color: #077ECE; font-size: 16px; margin-left: 10px; cursor: pointer;" @click="copy(item.source)"></i> -->
                    <!-- <img :src="srcali" @click="ali(item.id)" v-if="item.source.includes('tmall')"/> -->

                    <el-tooltip popper-class="tooltip" effect="dark" placement="top">
                      <div slot="content">{{tmall}}</div>
                      <div>
                        <img
                          :src="srcali"
                          @click="ali(item.id)"
                          @mouseover="alih(item.id)"
                          v-if="item.source.includes('tmall')"
                        />
                      </div>
                    </el-tooltip>
                  </div>
                  <div class="newhli">
                    外部订单编号：{{item.source_id}}
                    <i class="el-icon-document-copy" style="color: #077ECE; font-size: 16px; margin-left: 10px; cursor: pointer;" @click="copy(item.source_id)"></i>
                    <span v-if="item.source_id.indexOf('-C') != -1">
                      <el-popover placement="top-start" width="200" trigger="hover" content="该订单为拆分订单（电商平台购买数量大于2时自动拆分的订单）针对该订单的修改信息、加急、标旗备注、外呼已联系操作都将自动同步修改到其关联的拆分订单上。">
                         <span slot="reference">
                           <img src="../../../static/img/chai.png" @click="searchbrother(item.real_source_id)" style="width: 20px; margin-left: 10px; position: relative; top: 4px; cursor: pointer;"/>
                          </span>
                       </el-popover>
                    </span>

                  </div>
                  <div class="newhli" v-if="form.timems == 0">状态变更时间：{{item.status_updated_at}}</div>
                  <div class="newhli" v-if="form.timems == 1">用户下单时间：{{item.ordered_at}}</div>
                  <div class="newhli" v-if="form.timems == 2">平台创建时间：{{item.created_at}}</div>
                  <el-tooltip popper-class="tooltip" effect="dark" placement="top">
                    <div slot="content">{{item.memo}}</div>
                    <div>
                      <span
                        @click="choosecolorid(item.id,item.source_id)"
                        :style="{color:item.flag,fontSize:25+'px'}"
                        class="iconfont icon-flag-fill"
                      ></span>
                    </div>
                  </el-tooltip>
                </div>

                <div class="newright">
                  <el-tooltip v-if="item.complaint_job_id" popper-class="tooltip" effect="dark" placement="top">
                  	<div slot="content">该订单被用户投诉过，点击可查看详情</div>
                  	<div @click="todetail_s(item.complaint_job_id,item.complaint_job_status)" class="t_su">诉</div>


                  </el-tooltip>
				  <div v-if="item.is_fans" class="t_su" style="border-radius: 4px; right: 75px;
				  background: linear-gradient(218.83deg, rgb(255, 31, 31) 13.99%,rgb(255, 96, 200) 88.601%);">粉</div>
                </div>
              </div>
              <div class="newb">
                <div class="newt1">
                  <div style="padding: 15px;">
                    <div class="newtitle">商品名称:<span @click="todetail(item.order_pages_short_id)" style="cursor:pointer;color:#197cff">{{item.my_gname}}</span></div>
                    <div class="newcode">商品编码:{{item.my_gsku}}</div>
                    <div class="newcode">
                      <div style="display: flex;">
                        <div>产品编码:</div>
                        <dianjichakan :id="item.id"></dianjichakan>
                      </div>
                    </div>
                    <div class="newcode" v-if="item.plan_mobile != 0">购买号码:{{item.plan_mobile}}</div>
                    <div class="newcode" v-if="item.plan_mobile == 0">购买号码:无</div>

                    <!-- <div class="newcode">购买数量:{{item.amount}}</div> -->
                  </div>

                </div>
                <div class="newt2">
                  <div style="padding: 15px;">
                    <div class="newcar">
                      <span style="margin-right: 20px;">证件姓名：{{item.id_card_name}}</span>
                      收件人：{{item.address_name}}
                    </div>
                    <div class="newcar">
                      证件号码：{{item.id_card_num}}
                      <span  v-if="user.id != 304673 && user.id != 304672"
                        class="seephoto"
                        style="margin-left: 10px;"
                        @click="seephoto(item)"
                      >查看照片</span>
                      <span class="seephoto" style="margin-left: 10px;"
                      	@click="jiemi(item)"  v-if="user.id != 304673 && user.id != 304672">查看完整信息</span>
                    </div>
                    <div class="newcar">联系电话：{{item.address_mobile}}</div>
                    <div class="newcar">收货地址：{{item.address_province}}{{item.address_city}}{{item.address_district}}{{item.address}}</div>
                  </div>

                </div>

                <div class="newt3" v-if="act != 5">
                  <div style="padding: 15px;">
                    <el-tooltip effect="dark" popper-class="tooltip" placement="top">
                    	<div slot="content">
                        <div v-for="item2 in item.memo">
                          {{item2}}
                        </div>
                      </div>
                    	<div style="max-height:100px; overflow: hidden;">
                        <div v-for="item2 in item.memo">
                          {{item2}}
                        </div>
                      </div>
                    </el-tooltip>
                  </div>

                </div>
                <div class="newt3" v-if="act == 5">
                  <div style="padding: 15px;">

                    <el-tooltip effect="dark" popper-class="tooltip" placement="top">
                    	<div slot="content">
                        <div v-for="item2 in item.reason">
                          {{item2}}
                        </div>
                      </div>
                    	<div style="max-height:100px; overflow: hidden;">
                        <div v-for="item2 in item.reason">
                          {{item2}}
                        </div>
                      </div>
                    </el-tooltip>

                  </div>

                </div>
                <div class="newt4" style="flex:0.7">
                  <div style="padding: 15px;">
                    <div class="newcar">{{item.status_name}}</div>
                    <div class="newcar2" @click="seememo(item.seller_memo)">操作记录</div>
                    <div class="newcar" :style="{color:item.activeColor}">退款状态:{{item.refund_name}}</div>
                    <div class="newcar">激活状态:{{item.active_name}}</div>
                  </div>

                </div>
                <div class="newt5" style="flex:0.7">
                  <div style="padding: 15px;">
                    <div class="newcar">生产号码:</div>
                    <div class="newcar" v-if="item.plan_mobile_produced != null">{{item.plan_mobile_produced}}</div>
                    <div class="newcar" v-if="item.plan_mobile_produced == null">无</div>
                    <div class="newcar">iccid:</div>
                    <div class="newcar" v-if="item.iccid != null">{{item.iccid}}</div>
                    <div class="newcar" v-if="item.tracking_company != ''">{{item.tracking_company}}</div>
                    <div class="newcar" v-if="item.tracking_number != ''">{{item.tracking_number}}</div>
                    <!-- <div class="newcar2" @click="seememo(item.seller_memo)">操作记录</div> -->
                  </div>

                </div>
                <div class="newt6" style="flex:0.7">
                  <div style="padding: 15px;">
                    <div class="seebtn" @click="seedetail(item.id)"  v-if="user.id != 304673 && user.id != 304672">查看详情</div>
                    <div class="seebtn" v-if="act == 1 && func_I02 && user.id != 304673 && user.id != 304672" @click="seephoto(item)">修改照片</div>

                    <div class="seebtn" v-if="act == 6 && func_I02" @click="again1(item.id)">继续生产</div>
                    <div class="seebtn" v-if="act == 1 && item.status>=550" @click="seetracking(item.tracking_company,item.tracking_number)">查看物流</div>

                    <div class="seebtn" v-if="act == 2 && func_I02" @click="seephoto(item)">重传照片</div>
                    <div class="seebtn" v-if="act == 2 && func_I02" @click="giveoutone(item.id)">放弃订单</div>

                    <div class="seebtn" v-if="act == 7 && func_I02" @click="seephoto(item)">重传照片</div>
                    <div class="seebtn" v-if="act == 7 && func_I02" @click="giveoutone(item.id)">放弃订单</div>

                    <div class="seebtn" v-if="act == 4 && func_I02" @click="seephoto(item)">上传照片</div>
                    <div class="seebtn" v-if="act == 4 && func_I02" @click="giveoutone(item.id)">放弃订单</div>

                    <div class="seebtn" v-if="act == 3 && func_I02" @click="rep(item.id)">重新提交</div>
                    <div class="seebtn" v-if="act == 1 && func_I02 && item.status == -460" @click="rep(item.id)">重新提交</div>
                    <div class="seebtn" v-if="act == 3 && func_I02" @click="giveoutone(item.id)">放弃订单</div>

                    <div class="seebtn" v-if="act == 5 && func_I02" @click="seetracking(item.tracking_company,item.tracking_number)">查看单号</div>
                    <div class="seebtn" v-if="item.auto_deliver == 0 && act == 5 && func_I02" @click="chuli(item.id)" >已处理</div>

                    <div class="seebtn" v-if="act != 5 && func_I02">
                      <el-dropdown trigger="click" @click.native="choosefixid(item.id,item.source_id)" @command="fix">
                        <span class="el-dropdown-link"> 更多 <i class="el-icon-arrow-down el-icon--right"></i> </span>
                        <el-dropdown-menu slot="dropdown">
                          <el-dropdown-item command="fixpro">修改商品</el-dropdown-item>
                          <el-dropdown-item command="fixorder">修改订单信息</el-dropdown-item>
                          <el-dropdown-item v-if="(act == 1 || act == 6) && func_I02" command="backorder">取消订单</el-dropdown-item>
                          <el-dropdown-item command="fast">加急处理</el-dropdown-item>
                          <el-dropdown-item command="tousugongdan"  >创建投诉工单</el-dropdown-item>
                        </el-dropdown-menu>
                      </el-dropdown>
                    </div>

                    <div v-if="act !=6">
                      <div v-if="item.called == '未联系' && deliver_fail != 1" class="contact" @click="contact(item.id)"><i class="el-icon-phone"></i>未联系
                    </div>
                    <div v-if="item.called == '已联系' && deliver_fail != 1" class="contact2"><i class="el-icon-phone"></i>已联系</div>
                    </div>
                  </div>

                </div>
              </div>
            </div>

            <div class="fenye" style="text-align: right;">
              <el-pagination
                background
                layout="prev, pager, next"
                :current-page="page"
                @current-change="fanye"
                :page-size="page_size"
              ></el-pagination>
            </div>
          </div>
        </div>
      </div>
    </div>
    <el-dialog
      title="查看操作记录"
      :close-on-click-modal="false"
      :visible.sync="seememolog"
      width="800px"
    >
      <div v-html="memo" style="line-height: 30px;"></div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="seememolog = false">好的</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="修改订单信息"
      :close-on-click-modal="false"
      :visible.sync="seephotolog"
      width="1254px"
    >
      <div class="logflex">
        <div class="proimg" v-if="choose.face != ''">
          <img :src="choose.face" />
        </div>
        <div class="proimg" v-if="choose.face == ''">暂无照片</div>
        <div class="proimg" v-if="choose.back != ''">
          <img :src="choose.back" />
        </div>
        <div class="proimg" v-if="choose.back == ''">暂无照片</div>
        <div class="proimg" v-if="choose.hand != ''">
          <img :src="choose.hand" />
        </div>
        <div class="proimg" v-if="choose.hand == ''">暂无照片</div>
        <div class="protitle">
          <el-upload
            class="upload-demo"
            :show-file-list="false"
            action="https://jsonplaceholder.typicode.com/posts/"
            :on-change="uploadok"
            :auto-upload="false"
          >
            <el-button type="primary" size="small" @click="fixchoose('face')">修改正面照片</el-button>
          </el-upload>
        </div>
        <div class="protitle">
          <el-upload
            class="upload-demo"
            :show-file-list="false"
            action="https://jsonplaceholder.typicode.com/posts/"
            :on-change="uploadok"
            :auto-upload="false"
          >
            <el-button type="primary" size="small" @click="fixchoose('back')">修改反面照片</el-button>
          </el-upload>
        </div>
        <div class="protitle">
          <el-upload
            class="upload-demo"
            :show-file-list="false"
            action="https://jsonplaceholder.typicode.com/posts/"
            :on-change="uploadok"
            :auto-upload="false"
          >
            <el-button type="primary" size="small" @click="fixchoose('hand')">修改免冠照片</el-button>
          </el-upload>
        </div>
      </div>
      <div style="padding-top: 20px;">
        <el-form ref="form" @submit.native.prevent :model="choose" label-width="110px">
          <div class="flex">
            <el-form-item label="身份证姓名:">
              <el-input v-model="choose.id_card_name"></el-input>
            </el-form-item>
            <el-form-item label="身份证号码:">
              <el-input v-model="choose.id_card_num"></el-input>
            </el-form-item>
          </div>
          <div class="flex">
            <el-form-item label="收货人:">
              <el-input v-model="choose.address_name"></el-input>
            </el-form-item>
            <el-form-item label="联系电话:">
              <el-input v-model="choose.address_mobile"></el-input>
            </el-form-item>
          </div>
          <div class="flex">
            <el-form-item label="收货地址:" class="dz">
              <el-cascader @change="changeaddress2" v-model="choose.city" :options="options"></el-cascader><el-input v-model="choose.address"></el-input>
            </el-form-item>

          </div>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="repgo" :loading="repgoing">保存并重新提交</el-button>
      </span>
    </el-dialog>

    <el-dialog
      title="重新上传照片"
      :visible.sync="seephotolog2"
      :close-on-click-modal="false"
      width="1254px"
    >
      <div v-loading="seephotoloading">
        <div style="display: flex; justify-content: flex-end; width: 99%; ">
            <div @click="copyurl" style=" cursor: pointer; color: #409EFF; border: 1px #409EFF solid; padding: 5px; width: 160px; text-align: center; font-size: 14px; border-radius: 3px; margin-bottom: 20px;">复制订单专属照片上传连接</div>
        </div>

        <div class="logflex">
          <div class="proimg" v-if="choose.face != ''">
            <img :src="choose.face" />
          </div>
          <div class="proimg" v-if="choose.face == ''">暂无照片</div>
          <div class="proimg" v-if="choose.back != ''">
            <img :src="choose.back" />
          </div>
          <div class="proimg" v-if="choose.back == ''">暂无照片</div>
          <div class="proimg" v-if="choose.hand != ''">
            <img :src="choose.hand" />
          </div>
          <div class="proimg" v-if="choose.hand == ''">暂无照片</div>
          <div class="protitle" v-if="waitpic">
            <el-upload
              class="upload-demo"
              :show-file-list="false"
              action="https://jsonplaceholder.typicode.com/posts/"
              :on-change="uploadok"
              :auto-upload="false"
            >
              <el-button type="primary" size="small" @click="fixchoose('face')">修改正面照片</el-button>
            </el-upload>
          </div>
          <div class="protitle" v-if="waitpic">
            <el-upload
              class="upload-demo"
              :show-file-list="false"
              action="https://jsonplaceholder.typicode.com/posts/"
              :on-change="uploadok"
              :auto-upload="false"
            >
              <el-button type="primary" size="small" @click="fixchoose('back')">修改反面照片</el-button>
            </el-upload>
          </div>
          <div class="protitle" v-if="waitpic">
            <el-upload
              class="upload-demo"
              :show-file-list="false"
              action="https://jsonplaceholder.typicode.com/posts/"
              :on-change="uploadok"
              :auto-upload="false"
            >
              <el-button type="primary" size="small" @click="fixchoose('hand')">修改免冠照片</el-button>
            </el-upload>
          </div>
        </div>
      </div>

      <span slot="footer" class="dialog-footer">
        <!-- 照片等待上传、照片不合格才有资格改图片 -->
        <el-button type="primary" @click="reppicgo" size="small" v-if="waitpic && nowpicstatus == 150  && act != 7 && func_I02">提交至待审核</el-button>
        <el-button type="primary" @click="reppicgo" size="small" v-if="waitpic && nowpicstatus == -200  && act != 7 && func_I02">提交至待审核</el-button>


        <el-button type="primary" @click="reppicgo2" size="small" v-if="waitpic && act == 7 && func_I02">提交上游</el-button>
        <el-button type="primary" @click="seephotolog2 = false" size="small" v-if="!waitpic">好的</el-button>
      </span>
    </el-dialog>

    <el-dialog title="标旗设置" :visible.sync="flaglog" :close-on-click-modal="false" width="600px">
      <div style="display: flex;">
        <div style=" padding:0 20px; position: relative; top: 5px; ">标旗：</div>
        <el-radio-group v-model="flagradio" style="display: flex;">
          <el-tooltip
            style="margin-right: 20px;"
            popper-class="tooltip"
            effect="dark"
            placement="top"
            v-for="item in flaglist"
            :key="item.id"
          >
            <div slot="content">{{item.flag}}</div>
            <div>
              <el-radio :label="item.type">
                <span :style="{color:item.color,fontSize:25+'px'}" class="iconfont icon-flag-fill"></span>
              </el-radio>
            </div>
          </el-tooltip>
        </el-radio-group>
      </div>
      <div style="display: flex; margin-top: 20px; width: 530px;">
        <div style="padding-left: 20px; position: relative; width: 80px;">备注信息：</div>
        <div class="flagareaContent" v-html="flagarea"></div>
      </div>
      <div style="display: flex; margin-top: 20px; width: 530px;">
        <div style=" padding-left: 20px; position: relative; top: 5px; width: 100px;">添加备注：</div>
        <el-input type="textarea" :rows="3" placeholder="请输入备注" v-model="addflag"></el-input>
      </div>
      <div style="padding-left: 20px; padding-top: 20px;" v-if="amountchai.indexOf('-C') != -1"><span style="color: #DD2727;">注：</span>当前订单为拆分订单（电商平台购买数量大于2时自动拆分的订单）该操作将同步修改其它拆分关联订单的备注。</div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="flagloggo">确定</el-button>
      </span>
    </el-dialog>

    <el-dialog title="已联系修改" :visible.sync="contactlog" :close-on-click-modal="false" width="600px">
      <div style="display: flex;">确认标记为已联系？</div>

      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="contactgo" size="small" :loading="contacting">确定</el-button>
        <el-button type="primary" @click="contactgo2" size="small" :loading="contacting">确认并填写备注</el-button>
      </span>
    </el-dialog>

    <el-dialog
      title="查看运单信息"
      :visible.sync="trackinglog"
      :close-on-click-modal="false"
      width="600px"
    >
      <div style="display: flex; font-size: 16px; line-height: 30px;">运单公司：{{trackingcom}}</div>
      <div style="display: flex; font-size: 16px; line-height: 30px;">运单号码：{{trackingnum}}</div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="trackinglog = false">好的</el-button>
      </span>
    </el-dialog>

    <el-dialog title="修改商品" :visible.sync="fixprolog" width="30%" :close-on-click-modal="false">
      <div style="padding-right: 30px;">
        <el-form ref="form" @submit.native.prevent :model="form" label-width="150px">
          <el-form-item label="通过商品名称修改:">
            <!-- <el-input
              v-model="fixproname"
              :disabled="fixpronameshow"
              @input="searchproname"
              placeholder="输入商品名称"
            ></el-input> -->
            <el-select v-model="fixproname" clearable :disabled="fixpronameshow" @input="searchproname" filterable placeholder="请选择">
                <el-option v-for="item in allprolist" :key="item.id" :label="item.title" :value="item.id"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="通过商品编码修改:">
            <el-input
              v-model="fixprocode"
              :disabled="fixprocodeshow"
              @input="searchprocode"
              placeholder="输入商品编码"
            ></el-input>
          </el-form-item>
          <el-form-item label="查询结果:">{{fixpronames}}</el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="fixprolog = false">取 消</el-button>
        <el-button type="primary" @click="fixprook()" :loading="fixproing">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="批量修改商品" :visible.sync="fixprolog2" width="30%" :close-on-click-modal="false">
      <div style="padding-right: 30px;">
        <el-form ref="form" @submit.native.prevent :model="form" label-width="150px">
          <el-form-item label="通过商品名称修改:">

<!--            <el-input v-model="fixproname" :disabled="fixpronameshow" @input="searchproname"  placeholder="输入商品名称"></el-input>
 -->
            <el-select v-model="fixproname" clearable :disabled="fixpronameshow" @input="searchproname" filterable placeholder="请选择">
                <el-option v-for="item in allprolist" :key="item.id" :label="item.title" :value="item.id"></el-option>
            </el-select>

          </el-form-item>

          <el-form-item label="通过商品编码修改:">
            <el-input
              v-model="fixprocode"
              :disabled="fixprocodeshow"
              @input="searchprocode"
              placeholder="输入商品编码"
            ></el-input>
          </el-form-item>
          <el-form-item label="查询结果:">{{fixpronames}}</el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="fixprolog2 = false">取 消</el-button>
        <el-button type="primary" @click="fixprook2()" :loading="fixproing">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="修改信息" :visible.sync="fixorderlog" :close-on-click-modal="false" width="40%">
      <div>
        <el-form ref="form" @submit.native.prevent :model="form" label-width="90px">
          <div class="log">
            <el-form-item label="收货人">
              <el-input v-model="fixchooselist.address_name" placeholder></el-input>
            </el-form-item>
            <el-form-item label="身份证姓名">
              <el-input v-model="fixchooselist.id_card_name" placeholder></el-input>
            </el-form-item>
            <el-form-item label="身份证号">
              <el-input v-model="fixchooselist.id_card_num" placeholder></el-input>
            </el-form-item>
            <el-form-item label="联系电话">
              <el-input v-model="fixchooselist.address_mobile" placeholder></el-input>
            </el-form-item>
            <el-form-item label="收货地址" class="dz">
              <el-cascader @change="changeaddress" v-model="fixchooselist.city" :options="options"></el-cascader>
              <el-input
                v-model="fixchooselist.address"
                placeholder="详细地址"
              ></el-input>
            </el-form-item>
          </div>
          <div style="padding-left: 20px;" v-if="amountchai.indexOf('-C') != -1"><span style="color: #DD2727;">注：</span>当前订单为拆分订单（电商平台购买数量大于2时自动拆分订单）该操作将同步修改其它拆分关联订单的订单信息。</div>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="fixorderlog = false">取 消</el-button>
        <el-button type="primary" @click="fixorderok()">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="加急" :visible.sync="fastlog" :close-on-click-modal="false" width="30%">
      <div>
        <div class="propipei">
          ID为
          <span>{{fixid}}</span>的订单将标记为加急。
        </div>
        <div style="padding-top: 20px;" v-if="amountchai.indexOf('-C') != -1"><span style="color: #DD2727;">注：</span>当前订单为拆分订单（电商平台购买数量大于2时自动拆分订单）该操作将同步加急其它拆分关联订单。</div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="fastlog = false">取 消</el-button>
        <el-button type="primary" @click="fastok()">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="取消订单" :visible.sync="backorderlog" :close-on-click-modal="false" width="30%">
      <div>
        <div class="propipei">
          ID为
          <span>{{fixid}}</span>的订单将标记为取消订单。
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="backorderlog = false">取 消</el-button>
        <el-button type="primary" @click="backorderok()">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="修改产品结果" :visible.sync="shoplog" :close-on-click-modal="false" width="600px">
      <div>
        <div style="color: #077ECE; line-height: 30px;">成功{{shoplist.success}}条</div>
        <div style="color: #DF3434; line-height: 30px;">
          失败及原因：
          <div v-for="(item,i) in shoplist.error" :key="i">订单ID为:{{i}}的修改结果{{item}}</div>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="shoplog = false">好的</el-button>
      </div>
    </el-dialog>

    <el-dialog title="批量留言结果" :visible.sync="meslog" :close-on-click-modal="false" width="600px">
      <div>
        <div style="color: #077ECE; line-height: 30px;">成功{{meslist.success}}条</div>
        <div style="color: #DF3434; line-height: 30px;">
          失败及原因：
          <div v-for="(item,i) in meslist.error" :key="i">订单ID为:{{i}}的留言结果{{item}}</div>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="meslog = false">好的</el-button>
      </div>
    </el-dialog>

    <el-dialog title="短信通知" :visible.sync="emaillog" :close-on-click-modal="false" width="1200px">
        <div>
              <div class="emailridio">
                  <el-radio-group v-model="emailradio" @change = "emailwhich">
                        <el-radio-button label="按检索条件发送"></el-radio-button>
                        <el-radio-button label="按导入数据发送"></el-radio-button>
                  </el-radio-group>
              </div>
              <div class="emailform">
                  <el-form ref="form" @submit.native.prevent :model="form" label-width="100px">
                          <el-form-item label="检索条件:"  v-if="emailwhichshow">
                                <div class="emailtj">
                                      <div class="flex">

                                        <el-form-item label="订单状态" v-if="form.status != ''">
                                          <el-select v-model="form.status" clearable placeholder="请选择订单状态" disabled="disabled">
                                            <el-option label="初步审核" value="120"></el-option>
                                            <el-option label="等待上传照片" value="150"></el-option>
                                            <el-option label="待审核" value="200"></el-option>
                                            <el-option label="待开卡" value="450"></el-option>
                                            <el-option label="已领取" value="460"></el-option>
                                            <el-option label="开卡中" value="470"></el-option>
                                            <el-option label="待发货" value="500"></el-option>
                                            <el-option label="已发货" value="550"></el-option>
                                            <el-option label="已退货" value="-700"></el-option>
                                            <!-- <el-option label="已激活" value="5000"></el-option> -->
                                            <el-option label="开卡失败" value="-460"></el-option>
                                            <el-option label="证件不合格待重传" value="-200"></el-option>
                                            <el-option label="订单终止" value="0"></el-option>
                                          </el-select>
                                        </el-form-item>
                                        <el-form-item label="按照标旗:"  v-if="form.flag != ''">
                                          <el-select v-model="form.flag" clearable placeholder="标旗"  disabled="disabled">
                                            <el-option label="灰" value="0">
                                              <span style="float: left">
                                                <div class="color1"></div>
                                              </span>
                                              <span class="color1s">灰</span>
                                            </el-option>
                                            <el-option label="红" value="1">
                                              <span style="float: left">
                                                <div class="color2"></div>
                                              </span>
                                              <span class="color2s">红</span>
                                            </el-option>
                                            <el-option label="黄" value="2">
                                              <span style="float: left">
                                                <div class="color3"></div>
                                              </span>
                                              <span class="color3s">黄</span>
                                            </el-option>
                                            <el-option label="绿" value="3">
                                              <span style="float: left">
                                                <div class="color4"></div>
                                              </span>
                                              <span class="color4s">绿</span>
                                            </el-option>
                                            <el-option label="蓝" value="4">
                                              <span style="float: left">
                                                <div class="color5"></div>
                                              </span>
                                              <span class="color5s">蓝</span>
                                            </el-option>
                                            <el-option label="紫" value="5">
                                              <span style="float: left">
                                                <div class="color6"></div>
                                              </span>
                                              <span class="color6s">紫</span>
                                            </el-option>
                                          </el-select>
                                        </el-form-item>
                                        <el-form-item label="是否联系:"  v-if="form.is_called != ''">
                                          <el-select v-model="form.is_called" clearable placeholder="是否联系"  disabled="disabled">
                                            <el-option label="未联系" value="0">未联系</el-option>
                                            <el-option label="已联系" value="1">已联系</el-option>
                                          </el-select>
                                        </el-form-item>
                                        <el-form-item label="退款状态"  v-if="form.refund_status != ''">
                                          <el-select v-model="form.refund_status" clearable placeholder="退款状态"  disabled="disabled">
                                            <el-option label="正常" value="100">正常</el-option>
                                            <el-option label="退款中" value="200">退款中</el-option>
                                            <el-option label="退款成功" value="300">退款成功</el-option>
                                          </el-select>
                                        </el-form-item>
                                      </div>

                                      <div class="flex">
                                        <el-form-item label="订单来源:"  v-if="form.source != ''">
                                          {{form.source}}
                                        </el-form-item>
                                        <el-form-item label="订单ID:" v-if="form.order_id != ''">
                                              {{form.order_id}}
                                        </el-form-item>
                                        <el-form-item label="外部订单编号:" v-if="form.source_id != ''">
                                              {{form.source_id}}
                                        </el-form-item>


                                        <el-form-item label="商品编码:" v-if="form.good_sku != ''">
                                          {{form.good_sku}}
                                        </el-form-item>
                                      </div>

                                      <div class="flex">
                                        <el-form-item label="身份证号:" v-if="form.id_card_num != ''">
                                          {{form.id_card_num}}
                                        </el-form-item>
                                        <el-form-item label="生产号码:" v-if="form.mobile_produced != ''">
                                          {{form.mobile_produced}}
                                        </el-form-item>
                                        <el-form-item label="物流单号:" v-if="form.tracking_number != ''">
                                          {{form.tracking_number}}
                                        </el-form-item>
                                        <el-form-item label="收件人电话:" v-if="form.address_mobile != ''">
                                          {{form.address_mobile}}
                                        </el-form-item>
                                      </div>
                                      <div class="flex">
                                        <el-form-item label="激活状态"  v-if="form.active_status != ''">
                                          <el-select v-model="form.active_status" clearable placeholder="激活状态"   disabled="disabled">
                                            <el-option label="无" value="0">无</el-option>
                                            <el-option label="已激活" value="100">已激活</el-option>
                                            <el-option label="激活且充值" value="200">激活且充值</el-option>
                                          </el-select>
                                        </el-form-item>
                                        <el-form-item label="时间选择"  v-if="form.active_status != ''">
                                          <el-select v-model="form.timems" @change="timemschange" placeholder="时间选择"   disabled="disabled">
                                            <el-option label="状态变更时间" value="0">状态变更时间</el-option>
                                            <el-option label="用户下单时间" value="1">用户下单时间</el-option>
                                            <el-option label="平台创建时间" value="2">平台创建时间</el-option>
                                          </el-select>
                                          <el-date-picker   disabled="disabled"
                                            style="width: 470px;"
                                            v-model="form.time"
                                            @change="timechange"
                                            value-format="yyyy-MM-dd HH:mm:ss"
                                            type="datetimerange"
                                            range-separator="——"
                                            start-placeholder="开始日期"
                                            end-placeholder="结束日期"
                                          ></el-date-picker>
                                        </el-form-item>
                                      </div>
                                </div>
                          </el-form-item>
                          <el-form-item label="导入数据:"  v-if="!emailwhichshow" class="emailupload">
                              <div class="flex">
                                    <upload-excel-component @on-selected-file="exportData" class="btnp" buttonName="导入数据"></upload-excel-component>
                                    <span class="emaildown" @click="emaildown">下载模板</span>
                               </div>
                          </el-form-item>
                          <el-form-item label="共计条数:">
                                {{emailtotal}}条
                          </el-form-item>
                          <el-form-item label="短信签名:">
                                号卡生产平台
                          </el-form-item>
                          <el-form-item label="短信内容:">
                                <div>已输入<span class="red">{{emailnum}}</span>个字，共计<span class="red"> {{emailye}}</span>条短信。计费规则焦点显示：70字记一条短信费，超出70字则以70字每条计费。</div>
                                <el-input type="textarea" :rows="5" @input="emailjisuan" placeholder="请输入内容" v-model="emailtextarea"></el-input>
                                <div class="emailps">
                                  <div>温馨提示： </div>
                                  <div>1) 请留意短信内的敏感字词，例如：联通、电信、移动等可能导致短信被运营商拦截。 </div>
                                  <div>2) 短信内容包含：特卖、优惠、限时等营销词语可能会被手机安全软件拦截。 </div>
                                  <div>3) 禁止发送加QQ、加微信、招聘兼职、招商、代理相关内容的短信。</div>
                                </div>
                          </el-form-item>
                          <div class="emailfoot">
                                <div class="" v-if="emailradio == '按检索条件发送'"><el-button type="danger" size="small" @click="emailsend">确认发送</el-button></div>
                                <div class="" v-if="emailradio != '按检索条件发送'"><el-button type="danger" size="small" @click="emailsendm">确认发送</el-button></div>
                                <div class="emails"><span>当前余额：{{emailyu}}条</span><span class="emailchongzhi" @click="emailchongzhi">充值短信</span></div>
                          </div>
                  </el-form>
              </div>

        </div>

    </el-dialog>
	<el-dialog title="请输入导出密码" :visible.sync="mimalog" width="400px" :close-on-click-modal="false">
	          <div style="padding-right: 30px;">
	               <el-input v-model="mima" show-password placeholder="请输入导出密码"></el-input>
	          </div>
	          <div slot="footer" class="dialog-footer">
	            <el-button size="medium" type="primary" @click="mimaqueren">确 定</el-button>
	            <el-button size="medium" type="text" @click="mimachongzhilog = true">重设密码</el-button>
	          </div>
	    </el-dialog>

	    <el-dialog title="请设置导出密码" :visible.sync="mimasetlog" width="400px" :close-on-click-modal="false">
	<!--          <div style="padding-right: 30px; margin-bottom: 20px;">
	               <el-input v-model="mimashoujihao" disabled placeholder="请输入验证码"></el-input>
	          </div>
	          <div style="padding-right: 30px; margin-bottom: 20px; position: relative;">
	               <el-input v-model="mimacode"  placeholder="请输入验证码"></el-input>
	               <el-button style="padding: 9px 30px; position: absolute; right: 31px; top: 1px;"  type="danger" @click="getcode" :disabled="jinyong" size="mini">{{tishi}}</el-button>
	          </div> -->
	          <div style="padding-right: 30px; margin-bottom: 20px;">
	               <el-input v-model="mimaset" show-password placeholder="请设置导出密码"></el-input>
	          </div>
	          <div style="padding-right: 30px;">
	               <el-input v-model="mimaset2" show-password placeholder="请再次输入确认导出密码"></el-input>
	          </div>
	          <div style="color: #DF3434; margin-top: 10px;">为了您的订单数据安全，即日起所有批量导出数据的出口需输入导出密码才可导出，请与联系店铺负责人协商设置该密码</div>
	          <div slot="footer" class="dialog-footer">
	            <el-button size="medium"  @click="mimasetlog = false">取 消</el-button>
	            <el-button size="medium"  type="primary" @click="mimasetqueren">确 定</el-button>
	          </div>
	    </el-dialog>

	    <el-dialog title="重设导出密码" :visible.sync="mimachongzhilog" width="400px" :close-on-click-modal="false">
	          <div style="padding-right: 30px; margin-bottom: 20px;">
	               <el-input v-model="mimashoujihao" disabled placeholder="请输入验证码"></el-input>
	          </div>
	          <div style="padding-right: 30px; margin-bottom: 20px; position: relative;">
	               <el-input v-model="mimacode"  placeholder="请输入验证码"></el-input>
	               <el-button style="padding: 9px 30px; position: absolute; right: 31px; top: 1px;"  type="danger" @click="getcode" :disabled="jinyong" size="mini">{{tishi}}</el-button>
	          </div>
	          <div style="padding-right: 30px; margin-bottom: 20px;">
	               <el-input v-model="mimaset" show-password placeholder="请输入新密码"></el-input>
	          </div>
	          <div style="padding-right: 30px;">
	               <el-input v-model="mimaset2" show-password placeholder="请确认新密码"></el-input>
	          </div>
	          <div slot="footer" class="dialog-footer">
	            <el-button size="medium" @click="mimachongzhilog = false">取 消</el-button>
	            <el-button size="medium" type="primary" @click="mimaqueren2">确 定</el-button>
	          </div>
	    </el-dialog>
    <el-dialog title="短信充值" :visible.sync="rechargelog" :close-on-click-modal="false" width="1000px">
        <div>
              <div class="emailridio">
                  <el-radio-group v-model="rechargeradio" @change="rechargewhich">
                        <el-radio-button label="短信充值"></el-radio-button>
                        <el-radio-button label="充值记录"></el-radio-button>
                  </el-radio-group>
              </div>
              <div class="list" v-if="rechargeradio == '短信充值'">
                  <div class="flex">
                      <div class="listth">充值条数</div>
                      <div class="listth">单价</div>
                      <div class="listth">总价</div>
                      <div class="listth">操作</div>
                  </div>

                  <div class="flex" v-for="item in rechargelist" :key="item.id">
                      <div class="listtd">{{item.text_amount}}</div>
                      <div class="listtd">约{{item.per_amount}}分/条</div>
                      <div class="listtd">{{item.amount}}</div>
                      <div class="listtd rechargego" @click="rechargego(item.id)">立即充值</div>
                  </div>

              </div>
              <div class="list" v-if="rechargeradio != '短信充值'">
                  <div class="flex">
                      <div class="listth">交易流水号</div>
                      <div class="listth">充值金额</div>
                      <div class="listth">充值条数</div>
                      <div class="listth">充值前条数</div>
                      <div class="listth">充值后条数</div>
                      <div class="listth time">付款时间</div>
                  </div>

                  <div class="flex" v-for="item in rechargemlist" :key="item.id">
                      <div class="listtd">{{item.id}}</div>
                      <div class="listtd">{{item.total}}</div>
                      <div class="listtd">{{item.product_id}}</div>
                      <div class="listtd">{{item.before}}</div>
                      <div class="listtd">{{item.after}}</div>
                      <div class="listtd time">{{item.updated_at}}</div>
                  </div>
              </div>
        </div>
    </el-dialog>
    <el-dialog title="多个订单ID搜索" :visible.sync="duoxuanlog" :close-on-click-modal="false" width="600px">
    	<div>
    		<el-input type="textarea" :rows="10" placeholder="一行一个，可直接粘贴excel纵列数据" v-model="duoxuanids"></el-input>
    	</div>
    	<div slot="footer" class="dialog-footer">
    		<el-button type="primary" size="small" @click="search2">搜索</el-button>
    	</div>
    </el-dialog>
    <el-dialog title="多个生产号码搜索" :visible.sync="duoschm" :close-on-click-modal="false" width="600px">
    	<div>
    		<el-input type="textarea" :rows="10" placeholder="一行一个，可直接粘贴excel纵列数据" v-model="duoschminput"></el-input>
    	</div>
    	<div slot="footer" class="dialog-footer">
    		<el-button type="primary" size="small" @click="searchduoschm">搜索</el-button>
    	</div>
    </el-dialog>
    <el-dialog title="多个身份证号搜索" :visible.sync="duoxuanlogx" :close-on-click-modal="false" width="600px">
    	<div>
    		<el-input type="textarea" :rows="10" placeholder="一行一个，可直接粘贴excel纵列数据" v-model="duoxuanidsx2"></el-input>
    	</div>
    	<div slot="footer" class="dialog-footer">
    		<el-button type="primary" size="small" @click="search2x">搜索</el-button>
    	</div>
    </el-dialog>
    <bianmaquanxuan ref="bianmaquanxuan" @bianmaquanxuans="bianmaquanxuans" v-if="bianmaquanxuanshow" ></bianmaquanxuan>
    <!-- <foot></foot> -->
    <!-- 投诉弹窗 -->
	<tousuwindow :isshowwindow="isshowwindow" @creategd="creategd" @creategdhide="creategdhide" :tousuid="tousuid" />
  <daochulogs v-if="daochulogsall.show" ref="daochulogs" @daochulogsguanbi="daochulogsguanbi"  :type="1" ></daochulogs>
  </div>
</template>

<script>
import axios from "axios";
import daochulogs from "./zujian/daochu.vue";
import top from "@/components/top.vue";
import left from "@/components/left.vue";
import foot from "@/components/foot.vue"
import tousuwindow from "./tousuwindow.vue";
import bianmaquanxuan from "./zujian/bianmaquanxuan.vue";
import UploadExcelComponent from "@/components/UploadExcel/index.vue";
import { regionData, CodeToText, TextToCode } from "element-china-area-data";
import moment from "moment";

import dianjichakan from "./zujian/dianjichakan.vue";
export default {
  components: {
    left: left,
    top: top,
    foot: foot,
    UploadExcelComponent,
    dianjichakan,
    bianmaquanxuan,
    tousuwindow,daochulogs
  },
  name: "order_question",
  data() {
    return {
      daochulogsall:{
        show:false,
      },
			l04:false,
      pickerOptions0: {
          disabledDate(time) {
            let curDate = (new Date()).getTime();
            let three = 30 * 24 * 3600 * 1000;
            let threeMonths = curDate - three;
            return time.getTime() > Date.now() || time.getTime() < threeMonths;;
          }
      },
      amountchai:"",
      moredo:"",
      rechargemlist:"",
      rechargelist:"",
      rechargelog:false,
      rechargeradio:"短信充值",
      emailtotal:0,
      emaillist:"",
      emailyu:0,
      emailwhichshow:true,
      emailye:1,
      emailnum:0,
      emailtextarea:"",
      emailradio:'按检索条件发送',
      emailform:"",
      emaillog:false,
      export_data: "批量导入放弃",
      contacting: false,
      daochuing: false,
      daochuingz: "导出订单",
      progressVisible: false,
      percentage: 10,
      waitpic: false,
      repphotolog: false,
      flaglog: false,
      flagradio: 0,
      flagarea2: "",
      flagarea: "",
      addflag: '',
      seephotolog2: false,
      seephotoloading: false,
      city: "",
      options: regionData,
      seephotolog: false,
      contactlog: false,
      contactid: "",
      trackinglog: false,

      danxuans: [],
      quanxuana: false,
      quanxuans: [],

      shaixuan: [],

      total: 0,
      page: 1,
      page_size: 20,

      loading: false,
      shennum: 0,
      kainum: 0,
      tuinum: 0,
      wait_photos: 0,
      deliver_fail: 0,
      autofailnum: 0,
      xinwang_photo:0,
      xinwang:"",
      profailnum:0,

      color: "",
      form: {
        iccid:"",
        status: "",
        flag: "",
        source: "",
        source_id: "",
        id_card_num: "",
        amount: "",
        orderby: "",
        export: "",
        product_id: "",
        good_sku: "",
        pages_ids:"",
        deliver_fail: "",
        is_called: "",
        refund_status: "",
        order_id: "",
        mobile_produced: "",
        tracking_number: "",
        address_mobile: "",
        order_at_start: "",
        order_at_end: "",
        status_at_start: "",
        status_at_end: "",
        start: "",
        end: "",
        time: "",
        timems: "2",
        active_status: ""
      },
      list: "",
      choose: {
        id_card_name: "",
        id_card_num: "",
        address_name: "",
        address_mobile: "",
        address: "",
        face: "",
        back: "",
        hand: "",
        id: "",
        orderid: ""
      },
      which: "",

      func_I02: false,
      act: 1,
      desc: true,
      orderby: 1,

      memo: "",
      seememolog: false,

      flaglist: [],
      trackingcom: "",
      trackingnum: "",

      fixid: "",
      fixchooselist: {},

      fixprolog2: false,
      shoplog: false,
      shoplist: [],
      fixproing: false,

      fixprolog: false,
      backorderlog: false,
      probacklog: false,
      fastlog: false,
      fixorderlog: false,
      backprolog: false,
      whiteprolog: false,

      fixpronameshow: false,
      fixprocodeshow: false,
      fixproname: "",
      fixprocode: "",
      fixpronames: "",
      fixproid: "",

      shop_id: "",

      meslog: false,
      meslist: "",

      srcxian: "./static/img/shuxian.png",
      srcali: "./static/img/ali.png",
      tmall: "test",

      repgoing: false,
      daochulog: false,
      daochuflag: "",

      allprolist:[],
      clearable:false,
      nowpicstatus:0,
      scsource_id:"",

      mimalog:false,
      mima:"",
      mimaid:"",
      mimasetlog:false,
      mimaset:"",
      mimaset2:"",
      mimachongzhilog:false,
      mimashoujihao:"",
      mimacode:"",
      count: 60,
      tishi:"获取验证码",
      jinyong:false,
      daochutishi:false,

      bianmaquanxuanshow:false,
      allprolist2:[],
      //是否展示投诉弹窗
      isshowwindow:false,
      //投诉订单id
      tousuid:'',
      func_U:false,
      user:"",

      duoxuanlog: false,
      duoschm:false,
      duoschminput:'',
      duoschminput2:'',
      duoxuanids: "",
      duoxuanids2: "",
      duoxuanidsx:"",
      duoxuanidsx2:"",
      duoxuanlogx:false
    };
  },
  beforeDestroy() {
    document.onkeydown = null
  },
  created() {
    //按回车键搜索
    var that = this;
    document.onkeydown = function(e) {
      var ev = document.all ? window.event : e;
      if (ev.keyCode == 13) {
        that.search();
      }
    };

	//导出密码
	if( localStorage.getItem("daochumima") != null){
		this.mima = localStorage.getItem("daochumima")
	}

    //获取所有产品
    axios.get("/api/gth/order-pages?status=100&_page_size=10000")
      .then(function(response) {
        if(response.data.msg.code == 0){
            that.allprolist = response.data.data.data
        }
      })

    //第一次加载设置一个默认的时间一个月  不然太卡
    // this.form.end = moment()
    //   .add(1, "days")
    //   .format("YYYY-MM-DD 00:00:00");
    // this.form.start = moment()
    //   .subtract(7, "days")
    //   .format("YYYY-MM-DD 00:00:00");

    // this.form.time = [this.form.start, this.form.end];

    // this.getlist();
    this.getflag();
    this.getprolist();
    //权限问题
    var user = JSON.parse(localStorage.getItem("USER"));
	this.user = user
    this.user_func = user.functions;
    for (var i in this.user_func) {
      var func_number = this.user_func[i].code;
      if (func_number.indexOf("I02") >= 0) {
        this.func_I02 = true;
      }
	  if (func_number.indexOf("l04") >= 0) {
	  	this.l04 = true;
	  }
    if (func_number.indexOf("U") >= 0) {
					this.func_U = true;
				}

    }

    //获取店铺id
    axios.get("/api/gth/user/shop").then(response => {
      if (response.data.msg.code == 0) {
        that.shop_id = response.data.data.shop_id;
      } else {
        if (response.data.msg.code == 50401) {
          that.$router.push({ path: "/login" });
          return false;
        }
        that.$message.error(response.data.msg.info);
      }
    });

    //获取所有产品
    axios.get("/api/gth/order-pages?_page_size=5000")
    	.then(response=> {
    		if (response.data.msg.code == 0) {
    			this.allprolist2 = response.data.data.data
    		}
    	})
  },
  mounted() {
    this.getshoujihao()
  },
  methods: {
    daochulogsguanbi:function(item){

      this.daochu(item)
    },
    daochulogskai:function(){
      // this.daochulogsall.id = val.id
      this.daochulogsall.show = true
      this.$nextTick(()=>{
        this.$refs.daochulogs.chushihua()
      })
    },
    search2x: function() {
    	this.duoxuanidsx = this.duoxuanidsx2.split(/\n/)
    	for (let i in this.duoxuanidsx) {
    		this.duoxuanidsx[i] = this.duoxuanidsx[i].trim()
    	}
    	this.page = 1;
    	this.loading = true;
    	this.getlist();
    	this.duoxuanlogx = false
    },
    searchduoschm: function() {
      this.duoschminput2 = this.duoschminput.split(/\n/)
      for (let i in this.duoschminput2) {
        this.duoschminput2[i] = this.duoschminput2[i].trim()
      }
      this.page = 1;
      this.loading = true;
      this.getlist();
      this.duoschm = false
    },
    search2: function() {
      this.duoxuanids2 = this.duoxuanids.split(/\n/)
      for (let i in this.duoxuanids2) {
        this.duoxuanids2[i] = this.duoxuanids2[i].trim()
      }
      this.page = 1;
      this.loading = true;
      this.getlist();
      this.duoxuanlog = false
    },
    quanxuanyong:function(){
      this.bianmaquanxuanshow = true
      this.$nextTick(()=>{
        this.$refs.bianmaquanxuan.duoxuanlog2 = true
      })

    },
    bianmaquanxuans:function(data){
      console.log(data)
      this.form.pages_ids = data
    },

    chongzhisousuo:function(){
      let status = this.form.status
      this.form = {
        iccid:"",
        status: status,
        flag: "",
        source: "",
        source_id: "",
        id_card_num: "",
        amount: "",
        orderby: "",
        export: "",
        product_id: "",
        good_sku: "",
        pages_ids:"",
        deliver_fail: "",
        is_called: "",
        refund_status: "",
        order_id: "",
        mobile_produced: "",
        tracking_number: "",
        address_mobile: "",
        order_at_start: "",
        order_at_end: "",
        status_at_start: "",
        status_at_end: "",
        start: "",
        end: "",
        time: "",
        timems: "2",
        active_status: ""
      }

      this.duoxuanids = ''
      this.duoxuanids2 = ''
      this.duoschminput = ''
      this.duoschminput2 = ''
      this.duoxuanidsx = ''
      this.duoxuanidsx2 = ''

    },
    jiemi:function(item,index){

      this.$set(item,'id_card_name',this.decrypt(item.encrypt_id_card_name))
      this.$set(item,'id_card_num',this.decrypt(item.encrypt_id_card_num))
      this.$set(item,'address_name',this.decrypt(item.encrypt_address_name))
      this.$set(item,'address_mobile',this.decrypt(item.encrypt_address_mobile))
      this.$set(item,'address',this.decrypt(item.encrypt_address))

    },
    //导入处理模板
    uploadexcle:function(){
      const a = document.createElement('a');
    	a.setAttribute('download', '导入处理模板.xlsx');
    	a.setAttribute('href', window.location.origin+"/91haoka_platform/"+'static/dispose.xlsx');
    	a.click();
    },
    xiazaifangqi:function(){
      const a = document.createElement('a');
      a.setAttribute('download', '导入批量放弃.xlsx');
      a.setAttribute('href', window.location.origin+"/91haoka_platform/"+'static/fangqidingdan.xlsx');
      a.click();
    },
	goxiazai:function(){
	  // this.$router.push({
	  //   path:'/order_export2'
	  // })
	  let routeData = this.$router.resolve({path: '/order_export2'});
	  window.open(routeData.href, '_blank');
	},
		//重置密码确认
		mimaqueren2:function(){
		  if(this.mimaset != this.mimaset2){
		    this.$message.error("输入的密码不一致");
		    return false
		  }
		  axios.post("/api/plan-market/shop/pwd",{mobile:this.mimashoujihao,sms_code:this.mimacode,password:this.mimaset})
		      .then(response =>{
		          if(response.data.msg.code == 0){
		              this.$message.success("密码设置成功");
		              this.mimachongzhilog = false
		          }else{
		              this.$message.error(response.data.msg.info);
		          }
		      })
		},
		//获取验证码
		getcode:function(){
		  var that = this;
		  var params = new URLSearchParams();
		  params.append('mobile', this.mimashoujihao);
		  axios.post('/api/auth/sms_code', params)
		    .then(response => {
		      if(response.data.msg.code == 0){
		        this.$message({
		          message: '验证码已发送！',
		          type: 'success'
		        });
		        that.daojishi()
		      }else{
		        this.$message.error(response.data.msg.info);
		      }
		    })
		},
		//倒计时功能
		daojishi:function(){
		  var interval;
		  interval = window.setInterval(() => {
		    if(this.count <= 0){
		      window.clearInterval(interval)
		      this.tishi = "获取验证码",
		      this.jinyong = false
		      this.count = 60
		    }else{
		      this.count -= 1;
		      this.tishi = this.count+"秒重新获取"
		      this.jinyong = true
		    }
		  }, 1000);
		},
		//获取手机号发验证码
		getshoujihao:function(){
		  axios.get("/api/gth/my/shop/mobile")
		      .then(response =>{
		          if(response.data.msg.code == 0){
		              this.mimashoujihao = response.data.data
		          }else{
		              this.$message.error(response.data.msg.info);
		          }
		      })
		},
		//密码设置
		mimasetqueren:function(){
		  if(this.mimaset != this.mimaset2){
		    this.$message.error("输入的密码不一致");
		    return false
		  }
		  axios.post("/api/plan-market/shop/pwd",{mobile:this.mimashoujihao,sms_code:this.mimacode,password:this.mimaset})
		      .then(response =>{
		          if(response.data.msg.code == 0){
		              this.$message.success("密码设置成功");
		              this.mimasetlog = false
		          }else{
		              this.$message.error(response.data.msg.info);
		          }
		      })
		},
		//确认密码下载
		mimaqueren:function(){
		  this.daochu()
		  // axios.post("/api/plan-market/shop/log/url",{id:this.mimaid,password:this.mima})
		  //     .then(response =>{
		  //         if(response.data.msg.code == 0){
		  //           if(window.location.href.indexOf("91haoka_platform") > -1){
		  //             console.log("线上项目，谨慎操作。")
		  //             this.url = window.location.origin+"/"
		  //           }else{
		  //             this.url = ""
		  //           }
		  //           var a = document.createElement('a');

		  //           a.setAttribute('href', this.url+response.data.data.local_filename);
		  //           a.click();
		  //         }else{
		  //             this.$message.error(response.data.msg.info);
		  //         }
		  //     })
		},
		xiazai:function(){

		  //判断有没有密码
		  var that = this
		  axios.get("/api/plan-market/shop/pwd")
		    .then(function(response) {
		        if(response.data.msg.code == 0){
		              console.log(response)
		              if(response.data.data == ""){
		                //要设置密码
		                that.mimasetlog = true
		              }else{
		                //输入密码
		                that.mimalog = true
		              }
		        }else{
		              that.$message.error(response.data.msg.info);
		        }
		    });

		  //没有密码设置  有密码下载
		    //地址配置,用于下载模板
		    // if(window.location.href.indexOf("91haoka_platform") > -1){
		    // 	console.log("线上项目，谨慎操作。")
		    // 	this.url = window.location.origin+"/"
		    // }else{
		    // 	this.url = ""
		    // }
		    // var a = document.createElement('a');

		    // a.setAttribute('href', this.url+url);
		    // a.click();
		},
    //批量操作整合
    moredochange:function(){

        if(this.moredo == 0){
            if(this.danxuans == ''){
              this.$message({
                    message: "请先选择要修改的订单",
                    type: "warning"
              });
              return false
            }
            this.fixprolog2 = true
        }
        if(this.moredo == 1){
            this.giveout()
        }
        if(this.moredo == 2){
            this.message()
        }
    },
    //短信充值相关
    //获取套餐
    rechargeget:function(){
        var that =  this
        axios.get('/api/plan-market/text/packages')
                .then(response => {
                    if(response.data.msg.code == 0){
                        that.rechargelist = response.data.data
                    }
                })

    },
    //点击充值
    rechargego:function(id){

        var that =  this
        axios.post('/api/plan-market/text/recharge',{id:id})
                .then(response => {
                    if(response.data.msg.code == 0){
                          that.$message({
                            message: '充值短信成功',
                            type: 'success'
                          });
                          that.rechargelog = false
                    } else {
                          that.$message.error(response.data.msg.info);
                    }
                })
    },
    //获取记录
    rechargemget:function(){
        var that =  this
        axios.get('/api/plan-market/text/recharge/logs')
              .then(response => {
                  if(response.data.msg.code == 0){
                      that.rechargemlist = response.data.data.data
                  }
              })
    },
    //修改
    rechargewhich:function(e){
      console.log(e)
        if(e == "短信充值"){
            this.rechargeget()
        }else{
            this.rechargemget()
        }
    },
    //发送短信
    emailsendm:function(){
        var that = this
        axios.post("/api/plan-market/text/send", {mobiles:this.emaillist,sign:"落基伟业",template_id:"493359",template_params:['6666']})
            .then(function(response) {
                if(response.data.msg.code == 0){
                    that.$message({
                        message: '短信发送成功',
                        type: 'success'
                      });
                } else {
                    that.$message.error(response.data.msg.info);
                }
            })
    },
    emailsend:function(){
        var that = this
        this.form.source = this.form.source.trim();
        this.form.source_id = this.form.source_id.trim();
        this.form.id_card_num = this.form.id_card_num.trim();

        this.form.deliver_fail = this.form.deliver_fail.trim();
        this.form.order_id = this.form.order_id.trim();
        this.form.mobile_produced = this.form.mobile_produced.trim();
        this.form.tracking_number = this.form.tracking_number.trim();
        this.form.address_mobile = this.form.address_mobile.trim();

        var obj = {}
        obj['deliver_fail'] = this.deliver_fail
        obj['end'] = this.form.end
        obj['start'] = this.form.start
        obj['order_at_end'] = this.form.order_at_end
        obj['order_at_start'] = this.form.order_at_start
        obj['status_at_end'] = this.form.status_at_end
        obj['status_at_start'] = this.form.status_at_start
        obj['good_sku'] = this.form.good_sku
        obj['product_id'] = this.form.product_id
        obj['plan_mobile_produced'] = this.form.plan_mobile_produced
        obj['source'] = this.form.source
        obj['source_id'] = this.form.source_id
        obj['order_id'] = this.form.order_id
        obj['id_card_num'] = this.form.id_card_num
        obj['tracking_number'] = this.form.tracking_number
        obj['amount'] = this.form.amount
        obj['address_mobile'] = this.form.address_mobile
        obj['is_called'] = this.form.is_called
        obj['refund_status'] = this.form.refund_status
        obj['color'] = this.form.color
        obj['flag'] = this.form.flag
        obj['status'] = this.form.status
        obj['active_status'] = this.form.active_status

        obj['sign'] = "落基伟业"
        obj['template_id'] = "493359"
        obj['template_params'] = ['6666']


        axios.post("/api/plan-market/text/orders/send", obj)
            .then(function(response) {
                if(response.data.msg.code == 0){
                      that.$message({
                        message: '短信发送成功',
                        type: 'success'
                      });
                      that.emaillog = false
                } else {
                      that.$message.error(response.data.msg.info);
                }
            })
    },
    emaildown:function(){
      const a = document.createElement('a');
    	a.setAttribute('download', '导入短信手机号模板.xlsx');
    	a.setAttribute('href', window.location.origin+"/91haoka_platform/"+'static/email.xlsx');
    	a.click();
    },
    emailchongzhi:function(){
          this.emaillog = false
          this.rechargeget()
          this.rechargelog = true

    },
    //短信相关
    email:function(){
        this.getlist();
        this.emailget()
        this.emailtotal = this.total
        this.emaillog = true

    },
    //条件
    emailwhich:function(e){
        if(e == "按检索条件发送"){
          this.emailwhichshow = true
          this.emailtotal = this.total
        }else{
          this.emailwhichshow = false
          this.emailtotal = 0
        }
    },
    //获取剩余条数
    emailget:function(){
        var that =  this
        axios.get('/api/plan-market/shop/config/info')
              .then(response => {
                  if(response.data.msg.code == 0){
                      that.emailyu = response.data.data.text_amount
                  }
              })
    },
    //计数
    emailjisuan:function(){
        this.emailnum =  this.emailtextarea.length
        if(this.emailnum <= 70){
          this.emailye = 1
        }else{
          this.emailye = parseInt(this.emailnum / 70) + 1
        }

    },
    exportData(data) {
        console.log(data)
        if(data.header[0] == "发送短信的手机号"){
            var that = this;
            var list = [];
            for (var i = 0; i < data.results.length; i++) {
              list.push(data.results[i]["发送短信的手机号"])
            }
            this.emailtotal = list.length
            this.emaillist = list
        }
        else if(data.header[0] == "外部订单编号"){
            var that = this;
            var list = [];
            for (var i = 0; i < data.results.length; i++) {
              list.push(data.results[i]["外部订单编号"])
            }
            axios.post("/api/plan-market/order/auto/deliver", { source_ids: list })
                .then(response => {
                    if (response.data.msg.code != 0) {
                        that.$message.error(response.data.msg.info);
                    } else {
                        that.$message({
                            message: '已处理导入数据',
                            type: 'success'
                        });
                        this.loading = true;
                        this.getlist();
                    }
                });
        }
        else{
            var that = this;
            var list = [];
            //导入的是激活状态的情况
            for (var i = 0; i < data.results.length; i++) {
              var obj = {};
              obj["order_id"] = data.results[i]["订单ID"];
              obj["source_id"] = data.results[i]["外部订单编号"];

              if (obj["order_id"] != undefined) {
                obj["order_id"] = obj["order_id"].toString();
                obj["order_id"] = obj["order_id"].replace(/(^\s*)|(\s*$)/g, "");
              }
              if (obj["source_id"] != undefined) {
                obj["source_id"] = obj["source_id"].toString();
                obj["source_id"] = obj["source_id"].replace(/(^\s*)|(\s*$)/g, "");
              }
              list.push(obj);
            }
            this.daorulog = true;
            this.daoruing = true;
            axios
              .post("/api/gth/orders/abandon", { data: list })
              .then(function(response) {
                console.log(response);
                const status = response.status;
                const data = response.data;
                const msg = data.msg;
                const code = msg.code;
                if (status === 200 && code === 0) {
                  that.$message({
                    message: "订单已放弃，真让人感觉遗憾...",
                    type: "success"
                  });
                  that.getlist();
                } else {
                  if (status !== 200) {
                    that.percentage = 100;
                    that.progressVisible = false;
                    that.$message.error("网络异常");
                  } else {
                    that.percentage = 100;
                    that.progressVisible = false;
                    that.$message.error(msg.info);
                  }
                }
              })
              .catch(function(err) {
                that.$message.error("异常:" + err.message);
              });
        }

    },
    //复制阿里号
    ali: function(id) {
      var that = this;
      axios
        .get("/api/plan-market/order/nickname?order_id=" + id)
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            if (response.data.data.nickname != "") {
              that.copy(response.data.data.nickname);
            } else {
            }
          }
        });
    },
    alih: function(id) {
      var that = this;
      axios
        .get("/api/plan-market/order/nickname?order_id=" + id)
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            that.tmall = response.data.data.nickname;
          }
        });
    },
    //批量留言
    message: function() {
      if(this.danxuans == ''){
        this.$message({
              message: "请先选择要留言的订单",
              type: "warning"
        });
        return false
      }
      var arr = "";
      for (var i in this.danxuans) {
        console.log(this.danxuans[i]);
        arr = arr + this.danxuans[i] + ",";
      }
      arr = arr.substring(0, arr.lastIndexOf(","));
      var that = this;
      this.$prompt("请输入留言内容", "提示", {
        confirmButtonText: "确定留言",
        cancelButtonText: "取消"
      }).then(({ value }) => {
        axios
          .post("/api/plan-market/order/send-message", { msg: value, ids: arr })
          .then(response => {
            if (response.data.msg.code == 0) {
              if (response.data.data.error == "") {
                that.$message({
                  message: "修改商品成功",
                  type: "success"
                });
                this.getlist();
              } else {
                that.meslist = response.data.data;
                that.meslog = true;
                this.getlist();
              }
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      });
    },
    //跳转到上传页面
    goupload: function() {
      window.open(
        window.location.origin + "/#/upload?share_id=" + this.shop_id
      );
    },

    //选择时间
    timemschange: function() {
      this.form.time = "";
    },
    //选择时间
    timechange: function() {
      console.log(this.form.time);
      if (this.form.time != null) {
        if (this.form.timems == 0) {
          this.form.status_at_start = this.form.time[0];
          this.form.status_at_end = this.form.time[1];
          this.form.start = "";
          this.form.end = "";
          this.form.order_at_start = "";
          this.form.order_at_end = "";
        }
        if (this.form.timems == 1) {
          this.form.order_at_start = this.form.time[0];
          this.form.order_at_end = this.form.time[1];
          this.form.start = "";
          this.form.end = "";
          this.form.status_at_start = "";
          this.form.status_at_end = "";
        }
        if (this.form.timems == 2) {
          this.form.start = this.form.time[0];
          this.form.end = this.form.time[1];
          this.form.status_at_start = "";
          this.form.status_at_end = "";
          this.form.order_at_start = "";
          this.form.order_at_end = "";
        }
      } else {
        this.form.start = "";
        this.form.end = "";
        this.form.status_at_start = "";
        this.form.status_at_end = "";
        this.form.order_at_start = "";
        this.form.order_at_end = "";
      }
    },
    //选中的id记录
    choosefixid: function(id,source_id) {
      //查看是否是拆单
      this.amountchai = source_id

      this.fixid = id;
      console.log(this.fixid);
      var that = this;
      axios.get("/api/plan-market/order/info?order_id=" + id).then(response => {
        if (response.data.msg.code != 0) {
          that.$message.error(response.data.msg.info);
        } else {
          that.fixchooselist = response.data.data;

          that.fixchooselist.city = [];
          if (that.fixchooselist.status == "120") {
            that.fixchooselist.status = "初步审核";
          }
        }
      });
    },
    //修改
    fix: function(e) {
      console.log(e);
      if (e == "fixpro") {
        this.fixprolog = true;
      }
      if (e == "whitepro") {
        this.whiteprolog = true;
      }
      if (e == "fixorder") {
        this.fixorderlog = true;
        var city = [];
        try {
          if (this.fixchooselist.address_province != "") {
            city.push(TextToCode[this.fixchooselist.address_province].code);
          }
          if (this.fixchooselist.address_city != "") {
            city.push(
              TextToCode[this.fixchooselist.address_province][
                this.fixchooselist.address_city
              ].code
            );
          }
          if (this.fixchooselist.address_district != "") {
            city.push(
              TextToCode[this.fixchooselist.address_province][
                this.fixchooselist.address_city
              ][this.fixchooselist.address_district].code
            );
          }
        } catch (e) {
          console.log("从哪来的订单，别来搞老子");
        }

        this.fixchooselist["city"] = city;
        console.log(this.fixchooselist.city);
      }

      if (e == "backpro") {
        this.probacklog = true;
        //标记为已退货处理
        // 点确认执行probackok
      }
      if (e == "fast") {
        this.fastlog = true;
        //标记为加急
        // 点确认执行fastok
      }
      if (e == "backorder") {
        this.backorderlog = true;
        //标记为
        // 点确认执行backorderok
      }
      if (e == "refund") {
        this.$confirm(
          '确定给ID为"' + this.fixchooselist.id + '"的订单执行退款操作吗?',
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }
        ).then(() => {
          var that = this;
          this.loading = true;
          var params = new FormData();
          params.append("id", this.fixchooselist.id);
          axios.post("/api/ROS/plan/order/refund", params).then(response => {
            if (response.data.code != "SUCCESS") {
              this.$message.error(response.data.msg.info);
            } else {
              that.$message({
                type: "success",
                message: "已处理退款!"
              });
              that.getlist();
            }
            that.loading = false;
          });
        });
      }
      if (e == "fixstatus") {
        this.fixreasons = "";

        this.fixstatuslog = true;
      }
      if (e == "tousugongdan") {

					this.isshowwindow = true;
					this.tousuid = this.fixid
				}
    },
    //修改产品查询
    searchproname: function() {
      if (this.fixproname == "") {
        this.fixprocodeshow = false;
      } else {
        this.fixprocodeshow = true;
      }
      this.fixproid = this.fixproname;
      // this.fixpronames = "查询中...";
      // axios
      //   .get(
      //     "/api/plan-market/order-page/my?title=" +
      //       encodeURIComponent(this.fixproname)
      //   )
      //   .then(response => {
      //     if (response.data.msg.code != 0) {
      //       this.$message.error(response.data.msg.info);
      //     } else {
      //       if (response.data.data == null) {
      //         this.fixpronames = "销售中心无该产品信息";
      //         this.fixproid = "";
      //       } else {
      //         this.fixproid = response.data.data.id;
      //         this.fixpronames = response.data.data.title;
      //       }
      //     }
      //   });
    },
    searchprocode: function() {
      if (this.fixprocode == "") {
        this.fixpronameshow = false;
      } else {
        this.fixpronameshow = true;
      }
      this.fixpronames = "查询中...";
      axios
        .get(
          "/api/plan-market/order-page/my?fetch_code=" +
            encodeURIComponent(this.fixprocode)
        )
        .then(response => {
          if (response.data.msg.code != 0) {
            this.$message.error(response.data.msg.info);
          } else {
            if (response.data.data == null) {
              this.fixpronames = "没有查询到商品";
              this.fixproid = "";
            } else {
              this.fixproid = response.data.data.id;
              this.fixpronames = response.data.data.title;
            }
          }
        });
    },
    //修改商品ok
    fixprook: function() {
      this.fixproing = true;
      var that = this;
      axios
        .post("/api/plan-market/order/product/update", {
          page_id: this.fixproid,
          ids: this.fixid
        })
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
            that.fixproing = false;
          } else {
            if (response.data.data.error == "") {
              that.fixproing = false;
              that.$message({
                message: "修改商品成功",
                type: "success"
              });
              that.getlist();
              that.fixprolog = false;
            } else {
              for (let i in response.data.data.error) {
                that.$message.error(response.data.data.error[i]);
              }

              that.fixproing = false;
              that.getlist();
              that.fixprolog = false;
            }
          }
        });
    },
    //修改商品ok2
    fixprook2: function() {
      var arr = "";
      for (var i in this.danxuans) {
        console.log(this.danxuans[i]);
        arr = arr + this.danxuans[i] + ",";
      }
      arr = arr.substring(0, arr.lastIndexOf(","));
      if (this.fixproid == "" || this.danxuans == "") {
        this.$message.error("请选择要修改的订单和商品");
        return false;
      }
      this.fixproing = true;
      var that = this;
      axios
        .post("/api/plan-market/order/product/update", {
          page_id: this.fixproid,
          ids: arr
        })
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
            that.fixproing = false;
          } else {
            if (response.data.data.error == "") {
              that.fixproing = false;
              that.$message({
                message: "修改商品成功",
                type: "success"
              });
              that.getlist();
              that.fixprolog2 = false;
            } else {
              that.shoplist = response.data.data;
              that.shoplog = true;

              that.fixproing = false;
              that.getlist();
              that.fixprolog2 = false;
            }
          }
        });
    },
    //取消订单
    backorderok: function() {
      var that = this;
      var params = new URLSearchParams();
      params.append("id", this.fixid);
      axios.post("/api/plan-market/order/cancel", params).then(response => {
        if (response.data.msg.code != 0) {
          this.$message.error(response.data.msg.info);
        } else {
          this.backorderlog = false;
          this.$message({
            message: "修改状态成功",
            type: "success"
          });
          that.getlist();
        }
      });
    },
    //退货确认
    probackok: function() {
      var that = this;
      var params = new URLSearchParams();
      params.append("id", this.fixid);
      params.append("remark", this.backproreason);
      axios
        .post("/api/plan-market/order/return_product", params)
        .then(response => {
          if (response.data.msg.code != 0) {
            this.$message.error(response.data.msg.info);
          } else {
            this.probacklog = false;
            this.$message({
              message: "修改状态成功",
              type: "success"
            });
            that.getlist();
          }
        });
    },
    //加急处理
    fastok: function() {
      var that = this;
      var params = new URLSearchParams();
      params.append("id", this.fixid);
      axios.post("/api/plan-market/order/accelerate", params).then(response => {
        if (response.data.msg.code != 0) {
          this.$message.error(response.data.msg.info);
        } else {
          this.fastlog = false;
          this.$message({
            message: "修改状态成功",
            type: "success"
          });
        }
      });
    },
    //修改信息
    fixorderok: function() {
      console.log(this.fixchooselist);
      var that = this;
      axios
        .get("/api/plan-market/order/info?order_id=" + this.fixid)
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            var params = new URLSearchParams();
            params.append("id", that.fixid);
            if ( that.fixchooselist.address_name != response.data.data.address_name) {
              params.append("address_name", that.fixchooselist.address_name);
            }
            if ( that.fixchooselist.id_card_name != response.data.data.id_card_name) {
              params.append("id_card_name", that.fixchooselist.id_card_name);
            }
            if ( that.fixchooselist.id_card_num != response.data.data.id_card_num) {
              params.append("id_card_num", that.fixchooselist.id_card_num);
            }
            if ( that.fixchooselist.address_province !=response.data.data.address_province) {
              params.append( "address_province", that.fixchooselist.address_province );
            }
            if ( that.fixchooselist.address_city != response.data.data.address_city ) {
              params.append("address_city", that.fixchooselist.address_city);
            }
            if ( that.fixchooselist.address_district != response.data.data.address_district) {
              params.append( "address_district", that.fixchooselist.address_district);
            }

            if ( that.fixchooselist.address_province_code !=response.data.data.address_province_code) {
              params.append( "address_province_code", that.fixchooselist.address_province_code );
            }
            if ( that.fixchooselist.address_city_code != response.data.data.address_city_code ) {
              params.append("address_city_code", that.fixchooselist.address_city_code);
            }
            if ( that.fixchooselist.address_district_code != response.data.data.address_district_code) {
              params.append( "address_district_code", that.fixchooselist.address_district_code);
            }

            if (that.fixchooselist.address != response.data.data.address) {
              params.append("address", that.fixchooselist.address);
            }
            if (that.fixchooselist.address_mobile != response.data.data.address_mobile) {
              params.append( "address_mobile", that.fixchooselist.address_mobile );
            }

            axios.post("/api/plan-market/order/info/update", params)
              .then(response => {
                if (response.data.msg.code != 0) {
                  that.$message.error(response.data.msg.info);
                } else {
                  that.fixorderlog = false;
                  that.$message({
                    message: "修改状态成功",
                    type: "success"
                  });
                  that.getlist();
                }
              });
          }
        });
    },
    // //修改生产信息
    // whiteprook:function(){
    // 	var that = this
    // 	var params = new URLSearchParams();
    // 	params.append('id', this.fixid);
    // 	params.append('plan_mobile_produced', this.fixchooselist.plan_mobile_produced);
    // 	params.append('tracking_number', this.fixchooselist.tracking_number);
    // 	axios.post('/api/plan-market/order/info/update',params)
    // 		.then(response => {
    // 			if(response.data.msg.code != 0){
    // 					this.$message.error(response.data.msg.info);
    // 			}else{
    // 					this.probacklog = false
    // 					this.$message({
    // 						message: '录入信息成功',
    // 						type: 'success'
    // 					});
    // 					this.whiteprolog = false
    // 					that.getlist()
    // 			}
    // 		})
    // },
    //查看详情
    seedetail: function(id) {
      this.$router.push({
        path: "/order_question/orderDetail",
        query: { id: id }
      });
    },
    //处理功能
    chuli: function(id) {
      var that = this;
      this.$confirm("确定已处理?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        axios
          .post("/api/plan-market/order/auto/deliver", { order_id: id })
          .then(response => {
            if (response.data.msg.code != 0) {
              that.$message.error(response.data.msg.info);
            } else {
              this.loading = true;
              this.getlist();
            }
          });
      });
    },
    //查看运单号
    seetracking: function(com, num) {
      this.trackingcom = com;
      this.trackingnum = num;
      this.trackinglog = true;
    },
    //获取所有产品
    getprolist: function() {
      var that = this;
      axios
        .get("/api/gth/order-pages?_page_size=10000")
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            that.form.prolist = response.data.data.data;
          }
        });
    },
    //确认已联系
    contactgo: function() {
      this.contacting = true;
      var that = this;
      axios
        .post("/api/plan-market/order/call", { id: this.contactid })
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            that.loading = true;
            that.$message({
              message: "修改已联系！",
              type: "success"
            });
            that.getlist();
            that.contactlog = false;
            that.contacting = false;
          }
        });
    },
    //确认已联系并标旗
    contactgo2: function() {
      this.contacting = true;
      var that = this;
      axios
        .post("/api/plan-market/order/call", { id: this.contactid })
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            that.$message({
              message: "修改为已联系！",
              type: "success"
            });
            that.choosecolorid(that.contactid);
            that.contactlog = false;
            that.contacting = false;
          }
        });
    },
    //获取旗子
    getflag: function() {
      axios.get("/api/gth/shop/flag/info").then(response => {
        for (var i in response.data.data) {
          if (response.data.data[i].type == 0) {
            response.data.data[i].color = "#e4dfd7";
          }
          if (response.data.data[i].type == 1) {
            response.data.data[i].color = "#ee3f4d";
          }
          if (response.data.data[i].type == 2) {
            response.data.data[i].color = "#ebb10d";
          }
          if (response.data.data[i].type == 3) {
            response.data.data[i].color = "#229453";
          }
          if (response.data.data[i].type == 4) {
            response.data.data[i].color = "#2775b6";
          }
          if (response.data.data[i].type == 5) {
            response.data.data[i].color = "#8076a3";
          }
        }

        this.flaglist = response.data.data;
      });
    },
    //修改已联系
    contact: function(id) {
      this.contactid = id;
      this.contactlog = true;
    },
    //查看操作记录
    seememo: function(memo) {
      this.memo = memo;
      this.seememolog = true;
    },
    //排序
    shunxu: function() {
      this.loading = true;

      if (this.orderby == 0) {
        this.orderby = 1;
        this.desc = true;
      } else {
        this.orderby = 0;
        this.desc = false;
      }
      this.getlist();
    },
    //导出
    //导出
    daochu: function(item) {

      this.form.source = this.form.source.trim();
      this.form.source_id = this.form.source_id.trim();
      this.form.id_card_num = this.form.id_card_num.trim();

      this.form.deliver_fail = this.form.deliver_fail.trim();
      this.form.order_id = this.form.order_id.trim();
      this.form.mobile_produced = this.form.mobile_produced.trim();
      this.form.tracking_number = this.form.tracking_number.trim();
      this.form.address_mobile = this.form.address_mobile.trim();



      var data = {}
      data['password'] = this.mima
    // data['ids'] = this.duoxuanids2.toString()
      data['type'] = 4
      data['flag'] = 3
      data['deliver_fail'] = this.deliver_fail
      data['end'] = this.form.end
      data['start'] = this.form.start
      data['order_at_end'] = this.form.order_at_end
      data['order_at_start'] = this.form.order_at_start
      data['status_at_end'] = this.form.status_at_end
      data['status_at_start'] = this.form.status_at_start
      data['good_sku'] = this.form.good_sku
      data['pages_ids'] = this.form.pages_ids
      data['product_id'] = this.form.product_id
      data['plan_mobile_produced'] = this.form.mobile_produced
      data['orderby'] = this.orderby
      data['page'] = this.page
      data['page_size'] = this.page_size
      data['source'] = this.form.source
      data['source_id'] = this.form.source_id
      data['order_id'] = this.form.order_id
      data['id_card_num'] = this.form.id_card_num
      data['tracking_number'] = this.form.tracking_number
      data['amount'] = this.form.amount
      data['address_mobile'] = this.form.address_mobile
      data['is_called'] = this.form.is_called
      data['refund_status'] = this.form.refund_status
      data['color'] = this.form.flag
      data['status'] = this.form.status
      data['active_status'] = this.form.active_status
      data['plan_mobile_produceds'] = this.duoschminput2
      data['ids'] = this.duoxuanids2
      data['id_card_nums'] = this.duoxuanidsx.toString()
      data['model_id'] = item.act
      data['item_ids'] = item.arr
      data['is_old'] = 1

      // var url =
      //   "/api/plan-market/order/export?type=4&flag=3&deliver_fail=" +
      //   this.deliver_fail +
      //   "&end=" +
      //   this.form.end +
      //   "&start=" +
      //   this.form.start +
      //   "&order_at_end=" +
      //   this.form.order_at_end +
      //   "&order_at_start=" +
      //   this.form.order_at_start +
      //   "&status_at_end=" +
      //   this.form.status_at_end +
      //   "&status_at_start=" +
      //   this.form.status_at_start +
      //   "&good_sku=" +
      //   encodeURIComponent(this.form.good_sku) +
      //   "&product_id=" +
      //   this.form.product_id +
      //   "&plan_mobile_produced=" +
      //   this.form.mobile_produced +
      //   "&orderby=" +
      //   this.orderby +
      //   "&page=" +
      //   this.page +
      //   "&page_size=" +
      //   this.page_size +
      //   "&source=" +
      //   this.form.source +
      //   "&source_id=" +
      //   this.form.source_id +
      //   "&order_id=" +
      //   this.form.order_id +
      //   "&id_card_num=" +
      //   this.form.id_card_num +
      //   "&tracking_number=" +
      //   this.form.tracking_number +
      //   "&amount=" +
      //   this.form.amount +
      //   "&address_mobile=" +
      //   this.form.address_mobile +
      //   "&is_called=" +
      //   this.form.is_called +
      //   "&refund_status=" +
      //   this.form.refund_status +
      //   "&color=" +
      //   this.form.flag +
      //   "&status=" +
      //   this.form.status +
      //   "&active_status=" +
      //   this.form.active_status;

      this.daochuing = true;
      this.daochuingz = "导出中...";
      axios.post('/api/plan-market/order/export/new',data).then(response => {
        if (response.data.msg.code == 0) {

    	localStorage.setItem("daochumima",this.mima)

          // var a = document.createElement("a");
          // a.setAttribute("href", response.data.data);
          // a.click();
          this.daochuing = false;
          this.daochuingz = "导出订单";
          // this.daochulog = false;
          // this.mimalog = false
          //2021.3.1全部导出修改
          // this.$router.push({
          //   path:'/order_export2'
          // })
          let routeData = this.$router.resolve({path: '/order_export2'});
          window.open(routeData.href, '_blank');
        } else {
          this.$message.error(response.data.msg.info);
          this.daochuing = false;
          this.daochuingz = "导出订单";
        }
      });
    },
    copyurl:function(){
        var that = this;
        axios.get("/api/plan-market/getdunurl/?url=https://91haoka.cn/webapp/temporary/index.html?id="+this.scsource_id,)
        .then(response => {
            if(response.data.msg.code == 0){
              if(response.data.data != ''){
                that.$copyText(response.data.data).then(res => {
                  that.$message.success("复制成功");
                });
              }else{
                this.$message.error('短链生成失败');
              }

            }
        });

    },


    //查看照片
    seephoto: function(item) {
      this.jiemi(item)

      //没加载之前
      this.scsource_id = item.source_id
      this.waitpic = true;
      this.choose.id = item.id;
      this.choose.id_card_name = item.id_card_name;
      this.choose.id_card_num = item.id_card_num;
      this.seephotolog2 = true;
      this.seephotoloading = true;
      this.choose.face = "";
      this.choose.back = "";
      this.choose.hand = "";
      this.nowpicstatus = item.status

      var that = this;
      axios
        .get(
        	"/api/plan-market/order/photos/url?id_card_num=" +
        	item.id_card_num +
        	"&id=" +
        	item.id
        )
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            var random = Math.random();
            if (response.data.data.face_url != "") {
              that.choose.face = response.data.data.face_url + "?v=" + random;
            } else {
              that.choose.face = "";
            }
            if (response.data.data.back_url != "") {
              that.choose.back = response.data.data.back_url + "?v=" + random;
            } else {
              that.choose.back = "";
            }
            if (response.data.data.hand_url != "") {
              that.choose.hand = response.data.data.hand_url + "?v=" + random;
            } else {
              that.choose.hand = "";
            }
            that.seephotoloading = false;
          }
        });
    },
    //点击重提获取详细信息
    rep: function(id) {
      var that = this;
      axios.get("/api/plan-market/order/info?order_id=" + id).then(response => {
        if (response.data.msg.code != 0) {
          that.$message.error(response.data.msg.info);
        } else {
          response.data.data.face = "";
          response.data.data.back = "";
          response.data.data.hand = "";
          that.choose = response.data.data;
          axios
            .get(
              "/api/plan-market/order/photos/url?id_card_num=" +
                that.choose.id_card_num +
                "&id=" +
                that.choose.id
            )
            .then(response => {
              if (response.data.msg.code != 0) {
                that.$message.error(response.data.msg.info);
              } else {
                var random = Math.random();
                if (response.data.data.face_url != "") {
                  that.choose.face =
                    response.data.data.face_url + "?v=" + random;
                } else {
                  that.choose.face = "";
                }
                if (response.data.data.back_url != "") {
                  that.choose.back =
                    response.data.data.back_url + "?v=" + random;
                } else {
                  that.choose.back = "";
                }
                if (response.data.data.hand_url != "") {
                  that.choose.hand =
                    response.data.data.hand_url + "?v=" + random;
                } else {
                  that.choose.hand = "";
                }
              }
            });

          try {
            var city = [];
            if (this.choose.address_province != "") {
              city.push(TextToCode[this.choose.address_province].code);
            }
            if (this.choose.address_city != "") {
              city.push(
                TextToCode[this.choose.address_province][
                  this.choose.address_city
                ].code
              );
            }
            if (this.choose.address_district != "") {
              city.push(
                TextToCode[this.choose.address_province][
                  this.choose.address_city
                ][this.choose.address_district].code
              );
            }
            this.choose.city = city;
            console.log(this.choose.city)
          } catch (err) {
            console.log("地址对应不起来");
          }
          that.seephotolog = true;
        }
      });
    },
    //选择省市区重提用
    changeaddress2: function(v) {
        (this.choose.address_province = CodeToText[v[0]]),
        (this.choose.address_city = CodeToText[v[1]]),
        (this.choose.address_district = CodeToText[v[2]]);
        console.log(this.choose);
        console.log(
          "选中" +
            this.choose.address_province +
            this.choose.address_city +
            this.choose.address_district
        );
    },
    //选择省市区修改信息用
    changeaddress: function(v) {
        console.log(v)

        this.fixchooselist.address_province_code = v[0],
        this.fixchooselist.address_city_code = v[1],
        this.fixchooselist.address_district_code = v[2],

        this.fixchooselist.address_province = CodeToText[v[0]],
        this.fixchooselist.address_city = CodeToText[v[1]],
        this.fixchooselist.address_district = CodeToText[v[2]];
        console.log(
        "选中的省市区" +
          this.fixchooselist.address_province +
          this.fixchooselist.address_city +
          this.fixchooselist.address_district
      );
    },
    //修改信息
    repgo: function() {
      this.repgoing = true;
      var that = this;
      var params = new URLSearchParams();

      params.append("id", this.choose.id);

      params.append("id_card_name", this.choose.id_card_name);
      params.append("id_card_num", this.choose.id_card_num);

      params.append("address_province", this.choose.address_province);
      params.append("address_city", this.choose.address_city);
      params.append("address_district", this.choose.address_district);
      params.append("address", this.choose.address);

      params.append("address_mobile", this.choose.address_mobile);
      params.append("address_name", this.choose.address_name);

      axios
        .post("/api/plan-market/order/info/update", params)
        .then(response => {
          if (response.data.msg.code != 0) {
            this.$message.error(response.data.msg.info);
          } else {
            //调取更改状态
            axios
              .post("/api/plan-market/order/status/update", {
                id: this.choose.id,
                status: 120
              })
              .then(response => {
                if (response.data.msg.code != 0) {
                  that.$message.error(response.data.msg.info);
                } else {
                  that.repgoing = false;
                  that.seephotolog = false;
                  that.loading = true;
                  that.$message({
                    message: "修改信息成功",
                    type: "success"
                  });
                  that.getlist();
                }
              });
          }
        });
    },
    //点击重提获取详细信息
    reppic: function(id) {
      console.log(id);
      var that = this;
      axios.get("/api/plan-market/order/info?order_id=" + id).then(response => {
        if (response.data.msg.code != 0) {
          that.$message.error(response.data.msg.info);
        } else {
          var random = Math.random();
          if (response.data.data.face_url != "") {
            response.data.data.face_url =
              response.data.data.face_url + "?v=" + random;
          } else {
            response.data.data.face_url = "";
          }
          if (response.data.data.back_url != "") {
            response.data.data.back_url =
              response.data.data.back_url + "?v=" + random;
          } else {
            response.data.data.back_url = "";
          }
          if (response.data.data.hand_url != "") {
            response.data.data.hand_url =
              response.data.data.hand_url + "?v=" + random;
          } else {
            response.data.data.hand_url = "";
          }

          that.choose = response.data.data;
          that.repphotolog = true;
        }
      });
    },
    //重传照片确定 临时  我们用
    reppicgo2:function(){
      var that = this;
      //调取更改状态
      axios .post("/api/plan-market/xinwang/upstream_photo_upload", {id: this.choose.id})
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            that.repphotolog = false;
            that.loading = true;
            that.$message({
              message: "订单已提交至待审核",
              type: "success"
            });
            that.getlist();
            that.seephotolog2 = false;
          }
        });
    },
    //重传照片确定
    reppicgo: function() {
      var that = this;
      //调取更改状态
      axios .post("/api/plan-market/order/status/update", { id: this.choose.id, status: 200})
        .then(response => {
          if (response.data.msg.code != 0) {
            that.$message.error(response.data.msg.info);
          } else {
            that.repphotolog = false;
            that.loading = true;
            that.$message({
              message: "订单已提交至待审核",
              type: "success"
            });
            that.getlist();
            that.seephotolog2 = false;
          }
        });
    },
    //单个图片上传
    uploadok: function(file) {
      this.seephotoloading = true;
      var that = this;
      var formData = new FormData();
      formData.append("id_num", this.choose.id_card_num);
      formData.append("order_id", this.choose.id);
      formData.append("type", "plan");
      formData.append("pic[" + this.which + "]", file.raw);
      axios.post("/api/ROS/plan/photo/cut", formData).then(response => {
        if (response.data.msg.code != 0) {
          that.$message.error(response.data.msg.info);
        } else {
          //单张上传完之后 获取最新图片
          axios
            .get(
              "/api/plan-market/order/photos/url?id_card_num=" +
                this.choose.id_card_num +
                "&id=" +
                this.choose.id
            )
            .then(response => {
              if (response.data.msg.code != 0) {
                that.$message.error(response.data.msg.info);
              } else {
                var random = Math.random();
                if (response.data.data.face_url != "") {
                  that.choose.face =
                    response.data.data.face_url + "?v=" + random;
                } else {
                  that.choose.face = "";
                }
                if (response.data.data.back_url != "") {
                  that.choose.back =
                    response.data.data.back_url + "?v=" + random;
                } else {
                  that.choose.back = "";
                }
                if (response.data.data.hand_url != "") {
                  that.choose.hand =
                    response.data.data.hand_url + "?v=" + random;
                } else {
                  that.choose.hand = "";
                }
                that.seephotoloading = false;
              }
            });
        }
      });
    },
    //点击上传某张
    fixchoose: function(fbh) {
      this.which = fbh;
    },
    //等待照片上传订单
    wait: function() {
      this.deliver_fail = 0;
      this.page = 1;
      this.waitpic = true;
      this.act = 4;
      this.form.status = "150";
      this.xinwang = ""
      this.loading = true;
      this.getlist();

    },
    //全部
    searchall: function() {
      this.deliver_fail = 0;
      this.form.status = "";
      this.act = 1;
      this.waitpic = true;
      this.page = 1;
      this.xinwang = ""
      this.loading = true;
      this.getlist();

    },
    //审核失败的订单
    shenfail: function() {
      this.deliver_fail = 0;
      this.page = 1;
      this.waitpic = true;
      this.act = 2;
      this.form.status = "-200";
      this.xinwang = ""
      this.loading = true;
      this.getlist();

    },
    //开卡失败的订单
    kaifail: function() {
      this.deliver_fail = 0;
      this.page = 1;
      this.waitpic = true;
      this.act = 3;
      this.form.status = "-460";
       this.xinwang = ""
      this.loading = true;
      this.getlist();

    },
    tuikuan: function(){
      this.deliver_fail = 0;
      this.page = 1;
      this.waitpic = true;
      this.form.status = "450";
      this.act = 6;
       this.xinwang = ""
      this.loading = true;
      this.getlist();
    },
    linshi: function(){
      this.deliver_fail = 0;
      this.page = 1;
      this.waitpic = true;
      this.form.status = "470";
      this.act = 7;
      this.xinwang = 1
      this.loading = true;
      this.getlist();
    },
    profail:function(){
      this.deliver_fail = 1;
      this.page = 1;
      this.waitpic = true;
      this.act = 8;
       this.xinwang = ""
      this.form.status = "";
      this.loading = true;
      this.getlist();
    },
     //自动发货失败
    autofail: function() {
      this.deliver_fail = 1;
      this.page = 1;
      this.waitpic = true;
      this.act = 5;
       this.xinwang = ""
      this.form.status = "";
      this.loading = true;
      this.getlist();
    },
    //批量处理
    dispose: function() {
      const that = this
      var arr = "";
      for (var i in this.danxuans) {
        console.log(this.danxuans[i]);
        arr = arr + this.danxuans[i] + ",";
      }
      arr = arr.substring(0, arr.lastIndexOf(","));
      console.log(arr)
      var arrs = []
      arrs = arr.split(',')
      console.log(arrs)
      if(this.danxuans == ""){
        this.$message.error("请选择要处理的订单");
        return false
      }
      axios.post("/api/plan-market/order/auto/deliver",{order_ids:arrs}).then(response => {
        console.log(response)
        if(response.data.msg.code == 0) {
          console.log(response)
          that.$message({
                message: `处理成功${response.data.data}条`,
                type: "success"
              });
          that.loading = true;
          that.getlist();
        }
      })
    },
    again: function() {
      const that = this
      var arr = "";
      for (var i in this.danxuans) {
        console.log(this.danxuans[i]);
        arr = arr + this.danxuans[i] + ",";
      }
      arr = arr.substring(0, arr.lastIndexOf(","));
      console.log(arr)
      var arrs = []
      arrs = arr.split(',')
      console.log(arrs)
      axios.post("/api/plan-market/intercept/order/cancel",{orderId:arrs}).then(response => {
        console.log(response)
        if(response.data.msg.code == 0) {
          console.log(response)
          if(response.data.data == "success"){
            that.$message({
                  message: "继续生产成功",
                  type: "success"
                });
            that.tuikuan()
          }
        }
      })
    },

    //搜索
    search: function() {
      this.page = 1;

      this.loading = true;
      this.getlist();
    },
    //复制功能
    copy: function(t) {
      console.log(t)
      t = t.toString()
      var that = this;
      this.$copyText(t).then(res => {
      	that.$message.success("复制成功");
      });
    },
    //选择标旗id
    choosecolorid: function(id,source_id) {
      //查看是否是拆单的
      this.amountchai = source_id

      this.choose.id = id;
      this.flaglog = true;
      this.addflag = ''
      axios.get("/api/plan-market/order/memo?id=" + id).then(response => {
        this.flagarea = response.data.data.memo;
        this.flagradio = response.data.data.flag;
      });
    },
    //选择标旗确认
    flagloggo: function() {
      axios
        .post("/api/plan-market/order/flag", {
          color: this.flagradio,
          id: this.choose.id,
          memo: this.addflag
        })
        .then(response => {
          this.loading = true;
          this.flaglog = false;
          this.getlist();
        });
    },
    //选择标旗
    choosecolor: function(val) {
      axios
        .post("/api/plan-market/order/flag", { color: val, id: this.choose.id })
        .then(response => {
          this.getlist();
        });
    },
    //批量标旗
    moreflag: function() {
      this.loading = true;
      var arr = "";
      for (var i in this.danxuans) {
        console.log(this.danxuans[i]);
        arr = arr + this.danxuans[i] + ",";
      }
      arr = arr.substring(0, arr.lastIndexOf(","));

      axios
        .post("/api/gth/orders/handle", { flag: this.color, ids: arr })
        .then(response => {
          if (response.data.msg.code == 0) {
            this.$message({
              message: "批量标旗成功",
              type: "success"
            });
            this.getlist();
          } else {
            this.loading = false;
            this.$message.error(response.data.msg.info);
          }
        });
    },
    //批量放弃
    giveout: function() {
      if(this.danxuans == ''){
        this.$message({
              message: "请先选择要放弃的订单",
              type: "warning"
        });
        return false
      }
      this.$confirm("确定要批量放弃订单吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.loading = true;
        var arr = "";
        for (var i in this.danxuans) {
          console.log(this.danxuans[i]);
          arr = arr + this.danxuans[i] + ",";
        }
        arr = arr.substring(0, arr.lastIndexOf(","));
        axios
          .post("/api/gth/orders/handle", { status: 0, ids: arr })
          .then(response => {
            if (response.data.msg.code == 0) {
              this.$message({
                message: "订单已放弃，真让人感觉遗憾...",
                type: "success"
              });
              this.getlist();
              this.danxuans = [];
              this.quanxuana = false;
            } else {
              this.loading = false;
              this.$message.error(response.data.msg.info);
            }
          });
      });
    },
    //单个放弃订单
    giveoutone: function(id) {
      this.$confirm("确定要放弃此订单吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.loading = true;
        axios
          .post("/api/gth/orders/handle", { status: 0, ids: id })
          .then(response => {
            if (response.data.msg.code == 0) {
              this.$message({
                message: "订单已放弃，真让人感觉遗憾...",
                type: "success"
              });
              this.getlist();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      });
    },
    //继续订单
    again1: function(id) {
      const that = this
      console.log(id)
      var ids = []
      ids.push(id)
      axios.post("/api/plan-market/intercept/order/cancel",{orderId:ids}).then(response => {
        console.log(response)
        if(response.data.msg.code == 0) {
          console.log(response)
          if(response.data.data == "success"){
            that.$message({
                  message: "继续生产成功",
                  type: "success"
                });
            that.tuikuan()
          }
        }
      })
    },
    //查找拆单兄弟
    searchbrother:function(real_source_id){
      axios.get("/api/gth/orders/splited?real_source_id="+real_source_id)
          .then(response => {
            if (response.data.msg.code == 0) {
              for (var i in response.data.data.data) {
                if (response.data.data.data[i].flag == 0) {
                  response.data.data.data[i].flag = "#e4dfd7";
                }
                if (response.data.data.data[i].flag == 1) {
                  response.data.data.data[i].flag = "#ee3f4d";
                }
                if (response.data.data.data[i].flag == 2) {
                  response.data.data.data[i].flag = "#ebb10d";
                }
                if (response.data.data.data[i].flag == 3) {
                  response.data.data.data[i].flag = "#229453";
                }
                if (response.data.data.data[i].flag == 4) {
                  response.data.data.data[i].flag = "#2775b6";
                }
                if (response.data.data.data[i].flag == 5) {
                  response.data.data.data[i].flag = "#8076a3";
                }
              }

              this.list = response.data.data.data;
              this.loading = false;
              this.total = response.data.data.total;

              //全选使用
              this.ids();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
        },
    //获取列表
    getlist:function() {
      this.danxuans = [];
      this.quanxuana = false;
      this.form.source = this.form.source.trim();
      this.form.source_id = this.form.source_id.trim();
      this.form.id_card_num = this.form.id_card_num.trim();

      this.form.deliver_fail = this.form.deliver_fail.trim();
      this.form.order_id = this.form.order_id.trim();
      this.form.iccid = this.form.iccid.trim();
      this.form.mobile_produced = this.form.mobile_produced.trim();
      this.form.tracking_number = this.form.tracking_number.trim();
      this.form.address_mobile = this.form.address_mobile.trim();

      if (this.act == 1) {
        axios.get(
            "/api/plan-market/oldorders?type=1&deliver_fail=" +
              this.deliver_fail +
              "&end=" +
              this.form.end +
              "&start=" +
              this.form.start +
              "&order_at_end=" +
              this.form.order_at_end +
              "&order_at_start=" +
              this.form.order_at_start +
              "&status_at_end=" +
              this.form.status_at_end +
              "&status_at_start=" +
              this.form.status_at_start +
              "&good_sku=" +
              this.form.good_sku +
              "&pages_ids=" +
              this.form.pages_ids +
              "&product_id=" +
              this.form.product_id +
              "&plan_mobile_produced=" +
              this.form.mobile_produced +
              "&orderby=" +
              this.orderby +
              "&page=" +
              this.page +
              "&page_size=" +
              this.page_size +
              "&source=" +
              this.form.source +
              "&source_id=" +
              this.form.source_id +
              "&order_id=" +
              this.form.order_id +
              "&iccid=" +
              this.form.iccid +
              "&id_card_num=" +
              this.form.id_card_num +
              "&tracking_number=" +
              this.form.tracking_number +
              "&amount=" +
              this.form.amount +
              "&address_mobile=" +
              this.form.address_mobile +
              "&is_called=" +
              this.form.is_called +
              "&refund_status=" +
              this.form.refund_status +
              "&color=" +
              this.form.flag +
              "&status=" +
              this.form.status +
              "&active_status=" +
              this.form.active_status +
              "&ids=" +
              this.duoxuanids2 +
              "&plan_mobile_produceds=" +
              this.duoschminput2 +
              "&id_card_nums=" +
              this.duoxuanidsx.toString()
          )

          .then(response => {
            if (response.data.msg.code == 0) {
              for (var i in response.data.data.data) {
                if (response.data.data.data[i].flag == 0) {
                  response.data.data.data[i].flag = "#e4dfd7";
                }
                if (response.data.data.data[i].flag == 1) {
                  response.data.data.data[i].flag = "#ee3f4d";
                }
                if (response.data.data.data[i].flag == 2) {
                  response.data.data.data[i].flag = "#ebb10d";
                }
                if (response.data.data.data[i].flag == 3) {
                  response.data.data.data[i].flag = "#229453";
                }
                if (response.data.data.data[i].flag == 4) {
                  response.data.data.data[i].flag = "#2775b6";
                }
                if (response.data.data.data[i].flag == 5) {
                  response.data.data.data[i].flag = "#8076a3";
                }
              }

              this.list = response.data.data.data;
              for(var i=0;i<this.list.length;i++){
                if (this.list[i].refund_status == '退款中'){
                  this.list[i].activeColor = '#FFA200'
                }
                else if(this.list[i].refund_status == '退款成功'){
                  this.list[i].activeColor = '#DD2727'
                }else{
                  this.list[i].activeColor = ''
                }
              }
              this.loading = false;
              // this.total = response.data.data.total;

              //全选使用
              this.ids();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      } else {
        if(this.act == 6){
          axios.get("/api/gth/orders/trouble?type=1&is_incercept=1&deliver_fail=" +
              this.deliver_fail +
              "&end=" +
              this.form.end +
              "&start=" +
              this.form.start +
              "&order_at_end=" +
              this.form.order_at_end +
              "&order_at_start=" +
              this.form.order_at_start +
              "&status_at_end=" +
              this.form.status_at_end +
              "&status_at_start=" +
              this.form.status_at_start +
              "&good_sku=" +
              this.form.good_sku +
              "&pages_ids=" +
              this.form.pages_ids +
              "&product_id=" +
              this.form.product_id +
              "&mobile_produced=" +
              this.form.mobile_produced +
              "&orderby=" +
              this.orderby +
              "&page=" +
              this.page +
              "&page_size=" +
              this.page_size +
              "&source=" +
              this.form.source +
              "&source_id=" +
              this.form.source_id +
              "&order_id=" +
              this.form.order_id +
              "&id_card_num=" +
              this.form.id_card_num +
              "&tracking_number=" +
              this.form.tracking_number +
              "&iccid=" +
              this.form.iccid +
              "&amount=" +
              this.form.amount +
              "&address_mobile=" +
              this.form.address_mobile +
              "&is_called=" +
              this.form.is_called +
              "&refund_status=" +
              this.form.refund_status +
              "&color=" +
              this.form.flag +
              "&active_status=" +
              this.form.active_status).then(response => {
            console.log(response)
            if (response.data.msg.code == 0) {
              for (var i in response.data.data.data.data) {
                if (response.data.data.data.data[i].flag == 0) {
                  response.data.data.data.data[i].flag = "#e4dfd7";
                }
                if (response.data.data.data.data[i].flag == 1) {
                  response.data.data.data.data[i].flag = "#ee3f4d";
                }
                if (response.data.data.data.data[i].flag == 2) {
                  response.data.data.data.data[i].flag = "#ebb10d";
                }
                if (response.data.data.data.data[i].flag == 3) {
                  response.data.data.data.data[i].flag = "#229453";
                }
                if (response.data.data.data.data[i].flag == 4) {
                  response.data.data.data.data[i].flag = "#2775b6";
                }
                if (response.data.data.data.data[i].flag == 5) {
                  response.data.data.data.data[i].flag = "#8076a3";
                }
              }

              this.list = response.data.data.data.data;
              this.loading = false;
              // this.total = response.data.data.data.total;

              //全选使用
              this.ids();
            } else {
              this.$message.error(response.data.msg.info);
            }
          })
        }else {
          axios.get( "/api/gth/orders/trouble?type=1&deliver_fail=" +
              this.deliver_fail +
              "&end=" +
              this.form.end +
              "&start=" +
              this.form.start +
              "&order_at_end=" +
              this.form.order_at_end +
              "&order_at_start=" +
              this.form.order_at_start +
              "&status_at_end=" +
              this.form.status_at_end +
              "&status_at_start=" +
              this.form.status_at_start +
              "&good_sku=" +
              this.form.good_sku +
              "&pages_ids=" +
              this.form.pages_ids +
              "&product_id=" +
              this.form.product_id +
              "&mobile_produced=" +
              this.form.mobile_produced +
              "&orderby=" +
              this.orderby +
              "&iccid=" +
              this.form.iccid +
              "&page=" +
              this.page +
              "&page_size=" +
              this.page_size +
              "&source=" +
              this.form.source +
              "&source_id=" +
              this.form.source_id +
              "&order_id=" +
              this.form.order_id +
              "&id_card_num=" +
              this.form.id_card_num +
              "&tracking_number=" +
              this.form.tracking_number +
              "&amount=" +
              this.form.amount +
              "&address_mobile=" +
              this.form.address_mobile +
              "&is_called=" +
              this.form.is_called +
              "&refund_status=" +
              this.form.refund_status +
              "&color=" +
              this.form.flag +
              "&status=" +
              this.form.status +
              "&active_status=" +
              this.form.active_status+
              "&xinwang_photo="+this.xinwang
          )

          .then(response => {
            if (response.data.msg.code == 0) {
              for (var i in response.data.data.data.data) {
                if (response.data.data.data.data[i].flag == 0) {
                  response.data.data.data.data[i].flag = "#e4dfd7";
                }
                if (response.data.data.data.data[i].flag == 1) {
                  response.data.data.data.data[i].flag = "#ee3f4d";
                }
                if (response.data.data.data.data[i].flag == 2) {
                  response.data.data.data.data[i].flag = "#ebb10d";
                }
                if (response.data.data.data.data[i].flag == 3) {
                  response.data.data.data.data[i].flag = "#229453";
                }
                if (response.data.data.data.data[i].flag == 4) {
                  response.data.data.data.data[i].flag = "#2775b6";
                }
                if (response.data.data.data.data[i].flag == 5) {
                  response.data.data.data.data[i].flag = "#8076a3";
                }
              }

              this.list = response.data.data.data.data;
              this.loading = false;
              // this.total = response.data.data.data.total;

              //全选使用
              this.ids();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
        }

      }

      axios.get("/api/gth/orders/trouble/nums?end=" +
            this.form.end +
            "&start=" +
            this.form.start +
            "&order_at_end=" +
            this.form.order_at_end +
            "&order_at_start=" +
            this.form.order_at_start +
            "&status_at_end=" +
            this.form.status_at_end +
            "&status_at_start=" +
            this.form.status_at_start +
            "&good_sku=" +
            this.form.good_sku +
            "&pages_ids=" +
            this.form.pages_ids +
            "&product_id=" +
            this.form.product_id +
            "&mobile_produced=" +
            this.form.mobile_produced +
            "&orderby=" +
            this.orderby +
            "&page=" +
            this.page +
            "&page_size=" +
            this.page_size +
            "&source=" +
            this.form.source +
            "&source_id=" +
            this.form.source_id +
            "&order_id=" +
            this.form.order_id +
            "&id_card_num=" +
            this.form.id_card_num +
            "&tracking_number=" +
            this.form.tracking_number +
            "&amount=" +
            this.form.amount +
            "&address_mobile=" +
            this.form.address_mobile +
            "&is_called=" +
            this.form.is_called +
            "&refund_status=" +
            this.form.refund_status +
            "&color=" +
            this.form.flag +
            "&active_status=" +
            this.form.active_status
        )
        .then(response => {
          if (response.data.msg.code == 0) {
            this.kainum = response.data.data.open_fails;
            this.shennum = response.data.data.photo_fails;
            this.wait_photos = response.data.data.wait_photos;
            this.autofailnum = response.data.data.deliver_fails;
            this.tuinum = response.data.data.intercept_num
            this.xinwang_photo = response.data.data.xinwang_photo
            //全选使用
            this.ids();
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },

    //翻页
    fanye: function(val) {
      this.page = val;
      this.loading = true;
      this.getlist();
    },

    //全选的ids集合
    ids: function() {
      var checkids = [];
      for (var i in this.list) {
        checkids.push(this.list[i].id);
      }
      this.quanxuans = checkids;
    },
    //点击全选
    quanxuan: function() {
      if (
        this.danxuans.length != this.quanxuans.length ||
        this.danxuans.length == 0
      ) {
        this.danxuans = this.quanxuans;
        this.quanxuana = true;
      } else {
        this.danxuans = [];
        this.quanxuana = false;
      }
    },
    goLan: function() {
      this.$router.push({ path: "/order_question/lanjie" })
    },
    //点击单选
    danxuan: function() {
      // this.choosearea.push(this.checkedarea)
      if (this.danxuans.length == this.quanxuans.length) {
        this.quanxuana = true;
      } else {
        this.quanxuana = false;
      }
    },
    //调到商品详情
			todetail(id){
				console.log('000')
				window.open(window.location.origin +  window.location.pathname+"#/productionDelivery/shopdetail?id="+id)
			},
      //投诉子集传来关闭
			creategd(){
				this.isshowwindow = false
        this.getlist();
				console.log('投诉子集传来关闭')
			},
      creategdhide(){
				this.isshowwindow = false
			},
      //投诉进详情
			todetail_s(id,status){
        // if(status==2){
					//处理完成
					this.$router.push({
						path: '/tousugongdan/checkts',
						query:{id:id,tab:7}
					})
				// }else{
        //   //处理
        //   axios.post('/api/plan-market/admin/complaint/job/update/handler',{
        //     id:id,
        //     status:1
        //   })
        //   .then(response => {
        //     if (response.data.msg.code == 0) {
        //       this.$router.push({
        //       path: '/tousugongdan/checkts',
        //       query:{id:id,tab:7}
        //       })
        //     } else {
        //       this.$message.error(response.data.msg.info);
        //     }
        //   })
        // }

			}
  }
};
</script>

<style lang="scss" scoped>
/deep/ .el-button--danger {
      color: #FFF;
      background-color: #2974FF;
      border-color: #2974FF;
  }
  /deep/ .el-button--danger.is-plain {
      color: #18A0FB !important;
      background: #EEF7FF !important;
      border-color: #18A0FB !important;
  }
.index {
  /*滚动条样式*/
  .flagareaContent{
    width: 397px;
    min-height: 40px;
    max-height: 120px;
    padding: 5px 15px;
    border: 1px solid #DCDFE6;
    color: #C0C4CC;
    background-color: #F5F7FA;
    border-radius: 4px;
    overflow: auto;
  }
  .flagareaContent::-webkit-scrollbar {/*滚动条整体样式*/
    width: 8px;     /*高宽分别对应横竖滚动条的尺寸*/
    height: 4px;
  }
  .flagareaContent::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
    border-radius: 5px;
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background: #D8D8D8;
  }
  .flagareaContent::-webkit-scrollbar-track {/*滚动条里面轨道*/
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    border-radius: 0;
    background: #fff;
  }
  /deep/ .bao .el-button--primary {
    font-size: 14px;
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background-color: #fff !important;
    border: 1px solid #dcdfe6 !important;
    color: #606266 !important;
    -webkit-appearance: none;
    text-align: center;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    outline: 0;
    margin: 0;
    margin-left: 10px !important;
    -webkit-transition: 0.1s;
    transition: 0.1s;
    font-weight: 500;
    -moz-user-select: none;
    // padding: 8px 15px;
    font-size: 14px;
    border-radius: 4px;
    span{ font-size: 14px;}
}
.colorli {
  display: flex;
  width: 100px;
}
.colorli div {
  flex: 1;
  justify-content: space-between;
  line-height: 34px;
  text-align: center;
}
.tooltip {
  max-width: 300px;
  line-height: 30px;
}
/deep/ .el-input__inner {
  width: 220px;
          }
  .dz{
    /deep/ .el-cascader{ width: 100%;}
  }
  .emailridio{ margin-bottom: 20px;
      /deep/ .el-radio-button__orig-radio:checked+.el-radio-button__inner {
          color: #FFF;
          background-color: #EEF7FF;
          border-color: #EEF7FF;
          box-shadow: -1px 0 0 0 #EEF7FF;
      }
      /deep/ .el-radio-button__inner:hover{ color:#666 }
  }
  .emailform{
    .emailtj{ background: #eaeaea; padding: 20px 0;}
    .emailps{ background: #BFEEFF; padding: 10px; line-height: 25px; font-size: 14px; margin-top: 20px;}
    /deep/ .el-form-item{ margin-bottom: 0;}
  }
  .emailupload{
    /deep/ .el-button--primary{background: #EEF7FF; border: 1px solid #EEF7FF; padding: 8px 20px !important;}
  }
  .emaildown{ margin-left: 30px;}
  .red{ color: #EEF7FF; font-weight: bold; margin: 0 5px;}
  .emailfoot{ display: flex; justify-content: center; align-items: center; padding: 30px 0;
      .emails span{ margin-left: 20px;}

  }
  .list{ text-align: center; font-size: 14px; color: #666;

    .flex{}
    .listth{ background: #eaeaea; padding:10px 20px; flex: 1; }
    .listtd{ flex: 1; padding:10px 20px; border-bottom: 1px #eaeaea solid;}
     .time{ flex-basis: 100px;}
  }
  .rechargego{ cursor: pointer; color: #197cff;}
  .emailchongzhi{ color: #197cff; cursor: pointer;}

      .title {
        border-bottom: 1px #eaeaea solid;
        line-height: 45px;
        padding-left: 30px;
        font-size: 16px;
        background: #f9f9f9;
        color: #727272;
      }
      .o_ul {
        background: #f9f9f9;
        display: flex;
        .o_li {
          flex-basis: 160px;
          line-height: 45px;
          display: block;
          color: #727272;
          border-top: 3px #f9f9f9 solid;
          font-size: 14px;
          text-align: center;
        }
        .act {
          border-top: 3px #dd2727 solid;
          background: #ffffff;
        }

    .con {
      padding: 20px 0;
      .seebtn {
        cursor: pointer;
        text-align: center;
        color: #197cff;
      }
      /deep/ .el-dropdown {
        color: #197cff;
        font-size: 14px;
      }
      .w180 {
        .flex {
          /deep/ .el-form-item {
            margin-bottom: 20px;
          }
          /deep/ .el-form-item__label {
            font-size: 14px;

          }
          /deep/ .el-input {
            line-height: 32px;
            width: 220px;
          }
          /deep/ .el-form-item__content {

          }

          /deep/ .el-input__icon {

          }
        }
      }

      .seedetail {
        color: #197cff;
        cursor: pointer;
      }
      .powertable {
        margin: 0 10px;
      }
      .select {
        /deep/ .el-select {
          margin: 0 10px;
          line-height: 30px;
          width: 150px;
        }
        /deep/ .el-input__inner {
          width: 220px;
        }
        /deep/ .el-input__icon {
          line-height: auto;

        }
      }

      .btmm {
        /deep/ .el-button {

        }
      }

      .powerlist {
        display: flex;
        line-height: 45px;
        text-align: center;
      }
      .powerth {
        background: #e5e5e5;
        color: #666666;
        font-size: 14px;
        border-right: 1px #eaeaea solid;
      }

      .powerth:nth-child(1) {
        flex-basis: 50px;
      }
      .powertd:nth-child(1) {
        flex-basis: 50px;
      }
      .powerth:nth-child(2) {
        flex-basis: 0px;
        border: 0;
      }
      .powertd:nth-child(2) {
        flex-basis: 0px;
        border: 0;
      }
      .powerth:nth-child(3) {
        flex-basis: 200px;
      }
      .powertd:nth-child(3) {
        flex-basis: 200px;
      }
      .powerth:nth-child(4) {
        flex-basis: 150px;
      }
      .powertd:nth-child(4) {
        flex-basis: 150px;
      }
      .powerth:nth-child(5) {
        flex-basis: 150px;
      }
      .powertd:nth-child(5) {
        flex-basis: 150px;
      }

      .powerth:nth-child(6) {
        flex-basis: 100px;
      }
      .powertd:nth-child(6) {
        flex-basis: 100px;
      }
      .powerth:nth-child(7) {
        flex-basis: 150px;
      }
      .powertd:nth-child(7) {
        flex-basis: 150px;
      }
      .powerth:nth-child(8) {
        flex-basis: 70px;
      }
      .powertd:nth-child(8) {
        flex-basis: 70px;
      }
      .powerth:nth-child(9) {
        flex-basis: 140px;
      }
      .powertd:nth-child(9) {
        flex-basis: 140px;
      }
      .powerth:nth-child(10) {
        flex-basis: 58px;
      }
      .powertd:nth-child(10) {
        flex-basis: 58px;
      }
      .powerth:nth-child(11) {
        flex-basis: 100px;
      }
      .powertd:nth-child(11) {
        flex-basis: 100px;
      }

      .th1 {
        flex-basis: 80px;
        max-width: 80px;
      }
      .powertd {
        background: #ffffff;
        overflow: hidden;
        max-height: 66px;
        color: #888888;
        line-height: 33px;
        font-size: 14px;
        border-bottom: 1px #eaeaea solid;
        border-right: 1px #eaeaea solid;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
      }
      .fenye {
        text-align: right;
        margin: 20px 0;
      }
    }
  }
  .newflex {
    display: flex;
    justify-content: space-between;
  }
  .newsearch {
    display: flex;
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
    border-bottom: 3px #dcdcdc solid;
    .shuxian{
      img{ height: 20px; position: relative; top: 14px}
    }
    .act {
      color: #EEF7FF;
      border-bottom: 3px #EEF7FF solid !important;
    }
    .news1 {
      padding: 10px 20px;
      cursor: pointer; position: relative; top: 3px;
    }
    .news2 {
      padding: 10px 0;

      cursor: pointer;
    }
    .news3 {
      padding: 10px 0;

      cursor: pointer;
    }
    .news4 {
      padding: 10px 0;
      cursor: pointer;
    }
  }
  .newlistbor {
    margin-bottom: -1px;
  }
  .newlist {
    .newleft {
      display: flex;
      width: 100%;
    }
    .newthli {
      font-size: 14px;
      line-height: 40px;
      height: 40px;
      background: #f9f9f9;
      color: #646464;
      flex:1;
      text-align: center;
    }



    .newright {
      flex-basis: 116px;
      text-align: center;
    }

    .newh {
      display: flex;
      justify-content: space-between;
      background: #f3faff;
      line-height: 48px;
      height: 48px;
      color: #646464;
      font-size: 13px;
      border: 1px #eaeaea solid;
       border-bottom: 0;
      .newhli {
        margin-right: 10px;
        /deep/ .el-icon-document-copy {
          margin-left: 0 !important;
        }
        img {
          width: 20px;
          position: relative;
          top: 2px;
          cursor: pointer;
        }
      }
      .newhli:nth-child(1) {
        flex-basis: 50px;
        text-align: center;
      }
    }
    .newb {
      display: flex;
      font-size: 14px;
      color: #646464;
      line-height: 25px;
      margin-bottom: 10px;
      border: 1px #eaeaea solid;
      border-top: 0;
      .newt1 {

        flex:1;
        border-right: 1px #eaeaea solid;

      }
      .newt2 {
       flex:1;
       border-right: 1px #eaeaea solid;
      }
      .seephoto {
        color: #197cff;
        cursor: pointer;
      }

      .newt3 {
        flex:1;
        border-right: 1px #eaeaea solid;
      }
      .newt4 {
        flex:1;
        border-right: 1px #eaeaea solid;
        .newcar {
          max-height: 80px;
          overflow: hidden;
        }
        .newcar2 {
          color: #197cff;
          cursor: pointer;
        }
      }
      .newt5 {
        flex:1;
        border-right: 1px #eaeaea solid;
      }
      .newt6 {
        flex:1;
        border-right: 1px #eaeaea solid;
        .contact {
          margin-top: 5px;
          background: #EEF7FF;
          color: #ffffff;
          line-height: 25px;
          text-align: center;
          border-radius: 3px;
          cursor: pointer;
        }
        .contact2 {
          margin-top: 5px;
          color: #666;
          line-height: 25px;
          text-align: center;
          border-radius: 3px;
          cursor: pointer;
        }
      }
    }
  }
  .flex {
    display: flex;
    padding-right: 20px;
  }
  .logflex {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    /deep/ .el-button--primary {
      padding: 10px 30px;
    }
  }
  .logflex div {
    width: 377px;
    text-align: center;
  }
  .logflex .proimg {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 265px;
    background: #eaeaea;
  }
  .logflex .proimg img {
    max-width: 100%;
    max-height: 100%;
  }
  .protitle {
    color: #197cff;
    cursor: pointer;
    margin-top: 10px;
  }
  .propipei {
    padding-left: 90px;
    font-size: 14px;
    margin-bottom: 10px;
  }
  .propipei span {
    margin: 0 10px;
    color: #ff5053;
  }
}
.checkBtn{display: flex;align-items: center;}
.checkAll{display: inline-flex;align-items: center;font-size: 14px;}
.pageBox{
  margin-left: 730px;
  position: absolute;
  right: 0;
  .el-pagination{
    display: flex;
    .btn-prev{
      margin-right: 7px;
    }
    .btn-next,.btn-prev{
      padding: 0px 15px;
      height: 30px;
      border:1px solid rgba(183,183,183,1);
      opacity:1;
      border-radius:3px;
      span{
        font-size: 14px;
      }
    }
  }
}
.order_question .newlist .new-left{
  flex-basis: 1146px;
  position: relative;
}
.t_su{
		background-color: #AF0000;
		color: white;
		width: 26px;
		height: 26px;
		text-align: center;
		line-height: 26px;
		border-radius: 3px;
		cursor: pointer;
		margin-top:12px ;
		// position: absolute;
		// top: 12px;
		// right: 15px;
	}
</style>
